いくつかの通常のアラート ビューと「UINotificationAlertView」というカスタム アラート ビューがあります。カスタム UINotificationAlertView の「OK」ボタン クリック イベントで、最初のメソッドではなく 2 番目のメソッドを使用する必要があります。これどうやってするの?Objective C は初めてなので、これがばかげた質問である場合は申し訳ありません。
UINotificationAlertView *message = [[UINotificationAlertView alloc]
initWithTitle:@""
message:row.alertBody
delegate:self.
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
アプリ デリゲートの両方のメソッド:
//UIAlertView delegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == kNo) {
} else {
//Close by suspending...
[[UIApplication sharedApplication] suspend];
}
}
- (void)alertNotificationView:(UINotificationAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NSLog(@"phils new delegate");
if(buttonIndex == kNo) {
} else {
//Close by suspending...
[[UIApplication sharedApplication] suspend];
}
}