【发布时间】:2013-08-09 20:57:36
【问题描述】:
我有这个 if 语句检查我的委托是否实现了给定的方法:
if ([[self delegate] respondsToSelector:@selector(didFinishSettingNotificationOnDialog:)])
{
[self.delegate didFinishSettingNotificationOnDialog:self withNotification:notification];
}
但是我的代码没有在 If 语句中执行。如果我删除 if 语句并只调用
,我还有其他委托调用在这些对象之间工作和[self.delegate didFinishSettingNotificationOnDialog:self withNotification:notification];
它本身就可以工作!
我的委托确实正确实施:
- (void)didFinishSettingNotificationOnDialog:(NotificationDialogView *)dialogView withNotification:(NotificationContext *)setNotification{
NSLog(@"Notification is: %@", setNotification);
}
那我做错了什么?
【问题讨论】:
标签: ios objective-c cocoa-touch delegates uikit