Application Terminate?

Discussion in 'iOS Development' started by gojohnnyboi, Apr 4, 2008.

Thread Status:
Not open for further replies.
  1. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Whats the code to terminate the application on a UIAlertSheet buton click?

    Im recreating my commandX application, improving it in objectve-c, heres what i have:


    - (void)alertSheet

    Please Register or Log in to view images

    UIAlertSheet*)sheet buttonClicked

    Please Register or Log in to view images

    int)button
    {
    if ( button == 1 )
    system("[sheet textFieldAtIndex: 0]"); <----Also, i can't get it to execute. tried several things.
    else if ( button == 2 )
    ***NEED TERMINATE COMMAND!!***

    [sheet dismiss];

    that second button is an "Exit" button on the alert sheet.

    if somebody could please help with the execution as well, rep is offerd!!!
  2. jeppeb

    jeppeb New Member

    Joined:
    Apr 3, 2008
    Messages:
    14
    Likes Received:
    0
    [self terminateWithSuccess];

    and the execution:

    see my function (runCommand) and put this instead of system("[sheet textFieldAtIndex: 0]");
    Code:
    [self runCommand:[sheet textField] text]]
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55


    i get an error:

    CommandX:41: error: syntax error before ']' token

    i also got an error with the termination. not during compilation, just it doesn't work.


    ?? help ??
  4. jeppeb

    jeppeb New Member

    Joined:
    Apr 3, 2008
    Messages:
    14
    Likes Received:
    0
    Sorry, made a typo:
    Code:
    [self runCommand:[[sheet textField] text]];
    (I've you had Notepad++ you would have seen that immediately)

    And about the termination: try
    Code:
    [self terminate];
Thread Status:
Not open for further replies.

Share This Page