Objective c UIAlertView带有链接备用ViewController的按钮
我需要一个按钮,使一个带有操作的UIAlertView弹出 一旦警报弹出,它需要有一个按钮取消并停留在同一页面上,还有一个按钮将您链接到另一个ViewController 这是我从一些论坛拼凑出来的,但我不知道我在做什么,它给了我大约9条错误消息。请帮忙Objective c UIAlertView带有链接备用ViewController的按钮,objective-c,ios,cocoa-touch,uiviewcontroller,uialertview,Objective C,Ios,Cocoa Touch,Uiviewcontroller,Uialertview,我需要一个按钮,使一个带有操作的UIAlertView弹出 一旦警报弹出,它需要有一个按钮取消并停留在同一页面上,还有一个按钮将您链接到另一个ViewController 这是我从一些论坛拼凑出来的,但我不知道我在做什么,它给了我大约9条错误消息。请帮忙 -(IBAction)Alert:(id)sender { UIAlertView *Alert = [[UIAlertView alloc] initWithTitle:@"Alert"
-(IBAction)Alert:(id)sender {
UIAlertView *Alert = [[UIAlertView alloc] initWithTitle:@"Alert"
message:@"Warning! By entering the Tutorial, all data will be lost. Are you sure you want to continue?"
delegate:self
cancelButtonTitle:@"Return to Data Collection"
otherButtonTitles:@"Continue", nil];
[Alert Show];
[Alert Release];
}
第一个代码框起作用,因此当我按下主屏幕上的一个按钮时,会弹出一个带有两个按钮的警报 但是,我无法使用第二个按钮将我链接到下一个ViewController
[Alert show];
[Alert release];
及
(如果重命名这些方法,您认为它可以如何工作?)Tutorial*Info=[[Tutorial alloc]initWithNibName:nil bundle:nil];
从一开始就为你准备一本好书或一段视频
[Alert show];
[Alert release];
及
(如果重命名这些方法,您认为它可以如何工作?)Tutorial*Info=[[Tutorial alloc]initWithNibName:nil bundle:nil];
从一开始就给你一本好书或一段视频来学习。这样做。将nil传递给nibName很好-在这种情况下,它只加载名称与类名匹配的nib-Tutorial.xib。当然,如果nib没有被调用,那么你会有问题。将nib传递给nibName很好-它只加载名称与类名匹配的nib-Tuto当然,如果nib不是那样的话,那么你就有问题了。
- (void)alertView:(UIAlertView *)Alert clickedButtonAtIndex:(NSInteger)buttonIndex