Как использовать UIAlert, чтобы открыть NIB или UIView - PullRequest
1 голос
/ 26 ноября 2009

Вот мой код, пока я могу заставить URL работать, но я хочу загрузить перо с этой вкладки Alert

- (IBAction)aboutAction { // The action called when the about button is clicked.
        UIAlertView * aboutView = [[UIAlertView alloc] initWithTitle:@"Alert:" // Create a new UIAlertView named aboutScreen, and allocate it. Set the title to "About" 
                                                             message:@"MESSAGE GOES HERE" 
                                                            delegate:self 
                                                   cancelButtonTitle:@"Got It Thanks!"  
                                                   otherButtonTitles:@"Donate Now", nil]; 

            [aboutView show]; // Show the UIAlertView on the screen.
            [aboutView release]; // Release the UIAlertView from the memory.
    }


    -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
                if(buttonIndex == 1) { //Not sure what to do here.
                }

    }

Ответы [ 2 ]

1 голос
/ 04 марта 2010
-(void) alertView:(UIAlertView *) alertview clickedButtonAtIndex:(NSInteger)buttonIndex {

    switch (buttonIndex) {

        case 1: {
            Accidenthelpercall *help = [[Accidenthelpercall alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:help animated:NO];
        }


        case 2: {

            Accidentdamagecar *damagecar = [[Accidentdamagecar alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:damagecar animated:NO];

        }
}
0 голосов
/ 16 февраля 2012
-(void) alertView:(UIAlertView *) alertview clickedButtonAtIndex:(NSInteger)buttonIndex {

    switch (buttonIndex) {

        case 1: {
            Accidenthelpercall *help = [[Accidenthelpercall alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:help animated:NO];
            [help release];
        }


        case 2: {

            Accidentdamagecar *damagecar = [[Accidentdamagecar alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:damagecar animated:NO];
            [damagecar release];

        }
}
...