我有一个UIAlertView中,alertView,即在viewDidLoad中-方法初始化,如:使用在不同的地方相同的UIAlertView中
self.alertView = [[UIAlertView alloc] initWithTitle:@"Meddelande"
message:@"Do you want to continue?"
delegate:self
cancelButtonTitle:@"No"
otherButtonTitles:@"Yes", nil];
我也有一些metods的由pressning不同的按钮叫:
- (IBAction)didPressButton1 {
[self.alertView show];
}
我因子评分,这将显示alertView,但没有任何反应。一种解决方法是调用初始化的alertView并显示在同一时间梅托德,但我想这个工作。
的alertView的性质是这样的:
@property (nonatomic, strong) UIAlertView *alertView;
我还添加了在类扩展这样的delegats:
@interface MyViewController() <UIAlertViewDelegate>
@end
我在做什么错?
汉克
你能告诉我你定义的alertView属性吗? –
您是否添加了UIAlertViewDelegate? –