开发者

App crashing with this error message - I cannot find anything about this after googling it- Can someone help please

Im not getting any compile time errors nor anything comes up when I run Build & Analyze. But at run time my app crashes when I click a uitextfield.

-[__NSCFType textFieldDidBeginEditing:]: unrecognized selector sent to instance 0x583cb90

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType textFieldDidBeginEditing:]: un开发者_如何学Crecognized selector sent to instance 0x583cb90'


0   CoreFoundation               0x00fa25a9 __exceptionPreprocess + 185

1   libobjc.A.dylib      0x010f6313 objc_exception_throw + 44

2   CoreFoundation   0x00fa40bb -[NSObject(NSObject)doesNotRecognizeSelector:] + 187

3   CoreFoundation       0x00f13966 ___forwarding___ + 966

4   CoreFoundation       0x00f13522 _CF_forwarding_prep_0 + 50

5   UIKit    0x00394581 -[UIControl(Deprecated) sendAction:toTarget:forEvent:] + 67

6   UIKit 0x00396e62 -[UIControl(Internal) _sendActionsForEventMask:withEvent:] + 

7   UIKit   0x0039ce11 -[UITextField willAttachFieldEditor:] + 404

8   UIKit   0x003aecdf -[UIFieldEditor becomeFieldEditorForView:] + 653

9   UIKit   0x0039ef98 -[UITextField _becomeFirstResponder] + 99


Chances are that you are either not properly retaining the object you assign as the delegate of your UITextField (e.g. you don't assign it to an outlet property declared retain in IB), or you are calling release or autorelease on an object that you do not own or that you saved into an ivar.

The object eventually gets disposed of, and later a different object happens to be created at the same memory location. But that object, of course, doesn't implement the UITextFieldDelegate protocol, so when the text field tries to send the delegate messages to it it gives you that error instead. Were an object not to be created at that same memory location, you'd get a crash with EXC_BAD_ACCESS instead.


In Interface Builder (or possibly in code, but more likely IB) you have the "Editing Did Begin" Sent Event linked to a method that doesn't exist in your code; perhaps it was renamed, or maybe you neglected to delete that link after deleting the action.

When editing begins in your textField the app tries to call the method indicated in IB and fails; "unrecognized selector" is saying that it doesn't recognize a method by that name.

Either just delete the link or delete it and replace it with an appropriate link.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜