1
我需要在用戶按buttonIndex 1
後顯示確認提醒,但如果我使用popViewcontroller
在clickedButtonAtIndex
它崩潰沒有錯誤。在clickedButtonAtIndex中顯示警報?
的問題是,
[self.navigationController popViewControllerAnimated:YES];
之前第二警報單擊名爲...
如何解決?
這是我的代碼:
- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@"OK!"
message:@"Completed"
delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
[alert release];
[self.navigationController popViewControllerAnimated:YES];
}
}
我曾把UIAlertView中的一個子類,只是因爲人們無法在觸摸屏上點擊。命名這個代表的這個傢伙在地獄裏有一個特別的地方。 – 2011-01-27 16:52:11