Objective-C委托或自我变形类

时间:2012-06-18 20:58:58

标签: objective-c object delegates self

我有2个UIViewControllers(A,B)。 A被设置为B的委托,然后呈现B.协议设置在B的标题中:

@protocol BDelegate <NSObject>
- (IBAction)finishOrder:(id)sender;

@end

委托属性声明:

@property (nonatomic, assign) id<BDelegate> delegate;

A set B.delegate = self; 然后在按钮上按B调用:

if (self.delegate) {
        [self.delegate finishOrder:nil];
    }

然而,在第一次运行时,lldb给了我:

-[UITextInteractionAssistant finishOrder:]: unrecognized selector sent to instance

第二次运行:

-[NSInvocation delegate]: unrecognized selector sent to instance

第三次运行:

-[__NSCFDictionary delegate]: unrecognized selector sent to instance

跑步:

-[UITextTapRecognizer finishOrder:]: unrecognized selector sent to instance

所以......没有代码改变,但自我从A改为NSInvocation和__NSCFDictionary,B的代表(A的自我)改为UITextInteractionAssistant和UITextTapRecognizer ......从未见过类似的东西。有任何想法吗?谢谢!

1 个答案:

答案 0 :(得分:0)

你在某个地方过度释放。尝试打开Zombies,并使用Instruments追踪过度释放。