开发者

NSInvocation: object does not implement methodSignatureForSelector

开发者 https://www.devze.com 2023-01-01 06:19 出处:网络
I have this weird crash that only happens when running the app on the device (doesn\'t happen in the Simulator).

I have this weird crash that only happens when running the app on the device (doesn't happen in the Simulator). It seems like the problem surfaces out of nowhere, as I haven't changed anything on that particular class. I had the very same issue a few days ago, and I ended up fixing it by duplicating the class, renaming it, and changing the referenced class — I haven't changed a single bit of code.

So I'm trying to understand why it's doing this. I've read somewhere that usually you get this console error when the object isn't a subclass of NSObject (but it is!). Here's the exact console error message:

*** NSInvocation: warning: object 0x679e0 of class 'FFProximityPickerView' does not implement methodSignatureForSelector: -- trouble ahead
*** NSInvocation: warning: object 0x679e0 of class 'FFProximityPickerView' does not implement doesNotRecognizeSelector: -- abort

And then it crashes.

I'd be very thankful for anyone who can help me on this.

EDIT ----------------

This happened twice after I posted the issue. In the first case, I re-added the classes to the project and no more crashing. In the second case, I fixed all the warnings in the class that was crashing and it solved it. Will keep watching, but my guess so far is that I'm not fixing the warnings (I always tend to fix them all 开发者_开发技巧at once later)


If this ocurring when call a class method try extend your class with NSObject like this:

@interface sampleClass : NSObject


Too many unfixed warnings seem to create this issue. Just fix the warnings and it wont happen.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号