18
我該如何解僱UIAlertView?此代碼不起作用。我如何解僱UIAlertView?
@property (nonatomic, retain) UIAlertView *activityAlertView;
- (void)viewDidLoad
{
self.activityAlertView = [[UIAlertView alloc] initWithTitle:@"Receiving data" message:@"\n\n"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil, nil];
[activityAlertView show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
}
-(void) myfunc
{
[self alertView:activityAlertView clickedButtonAtIndex:1];
}
Thnx Buddy ... :-) – Ayaz 2013-02-26 13:53:51
使用取消按鈕索引可能更清晰:`[myAlertView dismissWithClickedButtonIndex:myAlertView.cancelButtonIndex animated:YES];`。 – 2015-02-09 09:23:50