我有一些常规警报视图和一个名为“UINotificationAlertView”的自定义警报视图我希望自定义 UINotificationAlertView 上的“确定”按钮单击事件使用第二种方法而不是第一种方法。我怎样才能做到这一点?我是目标 c 的新手,如果这是一个愚蠢的问题,我很抱歉。
UINotificationAlertView *message = [[UINotificationAlertView alloc]
                                    initWithTitle:@""
                                    message:row.alertBody
                                    delegate:self.
                                    cancelButtonTitle:@"OK"                      
                                    otherButtonTitles:nil];
App delgate 中的两种方法:
//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];
        }
    }