我有一个委托,它接收一条消息,以删除该项目作为参数的项目。我想显示一个确认 AlertView,然后,如果用户按是,我想删除它。
所以,我所拥有的是
被调用的委托方法:
- (void) deleteRecording:aRecording(Recording*)aRecording {
NSLog(@"Cancel recording extended view");
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: NSLocalizedString(@"Cancel recording",nil)
message: NSLocalizedString(@"Are you sure you want to cancel the recording?",nil)
delegate: self
cancelButtonTitle: NSLocalizedString(@"No",nil)
otherButtonTitles: NSLocalizedString(@"Yes",nil), nil];
[alert show];
[alert release];
}
那就是检查哪个按钮被按下的方法:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:
{
NSLog(@"Delete was cancelled by the user");
}
break;
case 1:
{
NSLog(@"Delete deleted by user");
}
}
}
所以,我的问题是,如何将 aRecording 参数从第一种方法发送到第二种方法?
非常感谢