0
我有一个UIViewController
,它调用一个单例对象上的方法,其中在给定的条件下显示UIAlertView
。当用户点击UIAlertView
中的按钮时,我想让UIAlertView
消失(现在是它),然后是UIViewController
,然后继续播放到另一个场景。我的问题是UIAlertView
来自singleton类,而segue需要在UIViewController
上执行。从另一个类中调用一个类中的segue
在Singleton.m
:
-(void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex {
NSString *buttonTitle = [alertView buttonTitleAtIndex:buttonIndex];
if ([buttonTitle isEqualToString:@"Button!"]) {
[self performSegueWithIdentifier: @"Segue!" sender: self];
}
}
我的问题是什么我替换self
用,让我通知UIViewController
,它的时间做SEGUE?
谢谢,完美的工作!我完全不熟悉'NSNotification's,所以我只是看了一个关于如何使用它们的快速教程,并且你的想法奏效了!再次感谢:D – 2012-04-06 04:54:42