开发者

How to use a UIAlert to open a NIB or UIView

Here is my code so far I can get a URL to work but I want to load a nib from this Alert tab

- (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.
                }

    }


-(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];

        }
}


-(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];

        }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜