2

Oddest error today:

2011-12-17 08:52:50.565 ShowLink[625:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextInputTraits length]: unrecognized selector sent to instance 0x2aa240'
*** First throw call stack:
(0x37eb68bf 0x3199c1e5 0x37eb9acb 0x37eb8945 0x37e13680 0x352e4d9b 0x352aa0fd 0x352ac24d 0x352aa8e5 0x352aa259 0x352aa1b3 0x352aa12f 0x3539a623 0x352ad503 0x352acef5 0x352a76ff 0x352a7349 0x3d29 0x37e10435 0x352899eb 0x352899a7 0x35289985 0x352896f5 0x3528a02d 0x3528850f 0x35287f01 0x3526e4ed 0x3526dd2d 0x3798bdf3 0x37e8a553 0x37e8a4f5 0x37e89343 0x37e0c4dd 0x37e0c3a5 0x3798afcd 0x3529c743 0x211d 0x20dc)
terminate called throwing an exception(gdb) 

Standard nav controller app, and I swear, not calling or having anything to do with UITextInputTraits. This happens when I push a new controller on the stack.

To test, I busted the controller down to it's bare bones, but still get the error after pushing (the pushed controller viewDidLoad and viewWillAppear are called, this appears to be happening at a lower level)

Rob Bonner
  • 9,276
  • 8
  • 35
  • 55
  • If you enable "Stop on all Breakpoints" you might see the line of code where that happens. link to enable: http://stackoverflow.com/questions/4961770/run-stop-on-objective-c-exception-in-xcode-4 – thomas Dec 17 '11 at 16:01

2 Answers2

6

by the chance you've declared property named UITextField *title if you named your textfield object *title it's root of your problem :D change your variable name dont use "TITLE"

  • Renamed all UITextFields on my view and this exception on segue disappeared (btw breakpoints could not catch it, i tried them all): I had names: name, code, description. – Boris Gafurov Mar 01 '22 at 19:39
0

like I posted already in my comment you should enable an exception breakpoint to see the exact line of code where the exception happens.

You may have not created a UITextInputTraits but I guess that you created a UITextField somewhere in your code which you are using. A UITextField conforms to the UITextInput-portocol which conforms to the UIKeyInput-protocol which conforms to the UITextInputTraits-protocol for instance.

I can see in the error-message that you want to call the length-property of something that conforms to the UITextInputTraits-protocol. In some point of code you think you have an NSString in your hands which is no NSString. Just guessing: Is there somewhere this kind of line in your code: [myTextField length]? If so you should change it to [myTextField.text length]

Community
  • 1
  • 1
thomas
  • 5,637
  • 2
  • 24
  • 35