我有兩個方法出現和消失UIAlertView中隱藏UIAlertView中在客觀-c
- (void)showAlert {
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"My Alert"
message:@"Do you want to continue?"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"No", @"Yes", nil];
[myAlert show];
}
// dismiss uialert
-(void)dismiss:(UIAlertView*)alert{
[alert dismissWithClickedButtonIndex:0 animated:YES];
}
我有,當我想打電話給我辭退方法的問題,我不知道該怎麼myAlert傳遞給解除方法以隱藏UIAlertView。
[self dismiss: // how to pas myAlert];
你想自動解僱alertview沒有選擇是或否?請簡潔明瞭 – Arun
UIAlertView中已被棄用。請參閱[本答案](http://stackoverflow.com/questions/4463806/adding-a-simple-uialertview/28383410#28383410)瞭解最新的示例。 – FreeNickname