[__NSCFType searchKeyword:]: unrecognized selector sent to instance 0x6d8eb80

空扰寡人 提交于 2019-12-05 04:16:51

You need to retain your EventSearchViewController, or keep a strong reference to it if you're using ARC. If you assign it to view1 as a local variable, it's not going to be around any more when searchKeyword: gets called. (The error shows that its memory has been released and re-used for a different type of object.)

For me the problem was that I never called

- (void)removeTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents

before I called

- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents

again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!