1

I've dealt with this error before (unrecognized selector sent to instance) and it makes sense to me but in this particular circumstance I'm confused on where to look inside the application. If you fire up the app it doesn't matter what you do, the app will crash after 10 seconds. There are a slew json calls made in the background so I assume that the error is happening somewhere within those calls but breakpointing every code statement block will be very inefficient. Is it possible to get a stack trace for this? If not, what's the best way to go about resolving this issue?

2015-05-05 15:00:27.833 MyApp[1546:195020] -[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x17027a680
2015-05-05 15:00:32.836 MyApp[1546:195020] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x17027a680'
*** First throw call stack:
(0x1831e82d8 0x194a140e4 0x1831ef3a4 0x1831ec154 0x1830eeccc 0x100092630 0x182bab310 0x1840cf1c4 0x184020604 0x1840101cc 0x1840d1f28 0x100288f94 0x100293db8 0x10028c2c4 0x1002965d4 0x100298248 0x19524522c 0x195244ef0)
libc++abi.dylib: terminating with uncaught exception of type NSException

In this image you can see the thread where this crash is happening. It looks like the cause may be inside of a NSNotification or something like that but I'm not sure.

enter image description here

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
  • Have you tried [enabling zombie objects](http://stackoverflow.com/questions/4168327/what-is-nszombie)? If you don't already know, [heres how you can use this option](http://stackoverflow.com/questions/5386160/how-to-enable-nszombie-in-xcode). It won't be very useful for pinpointing other types of issues, but is quite effective in *unrecognized selector* and *deallocated objects* – Swapnil Luktuke May 05 '15 at 19:33
  • @lukya I enabled zombies per the reference you gave but I'm seeing the exact same issue with that exact same crash :/ – Jacksonkr May 05 '15 at 19:35
  • 1
    Does adding an exception breakpoint not show you the line causing the error? – rdelmar May 05 '15 at 19:45
  • @rdelmar That is exactly the the "more efficient" way I was looking for. I didn't know there were different *types* of breakpoints. Thanks your for making my life as a developer that much easier. Add that as an answer and I'll accept it. – Jacksonkr May 05 '15 at 20:08

1 Answers1

0

Using an exception breakpoint disambiguated everything. Without it I was stuck break pointing lines upon lines of code.

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284