如何使用 UIAlert 打开 NIB 或 UIView

发布于 2024-08-13 07:41:14 字数 1016 浏览 2 评论 0原文

到目前为止,这是我的代码,我可以获得一个可以工作的 URL,但我想从此“警报”选项卡加载一个笔尖

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

    }

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

    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

箹锭⒈辈孓 2024-08-20 07:41:14
-(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];
        }


        case 2: {

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

        }
}
如果没有你 2024-08-20 07:41:14
-(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];

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

        }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文