我希望使用UIAlertView提示符来提醒用户一些消息,alerview将在2秒内自动关闭。
我的代码:
IBOutlet UIAlertView *aUIAlertView;
....
@property (retain,nonatomic) IBOutlet UIAlertView *aUIAlertView;
....
UIAlertView * alert=[[UIAlertView alloc]
initWithTitle: @"Reminder"
message: @"Message"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil, nil];
[NSTimer scheduledTimerWithTimeInterval:2
target:self
selector:@selector(timerFired1:)
userInfo:nil
repeats:NO];
aUIAlertView=alert;
[alert show];
- (void)timerFired1:(NSTimer *)timer {
[aUIAlertView release];//I set the breakpoint here, aUIAlertView is not nill
}
计时器被提示,aUIAlertView不是nil。
欢迎任何评论
谢谢