1

Since today my breakpoints stopped working in Xcode 5.1. I have an unrecognized selector sent to an NSArray, but the debugger does not show the line where the error occurs. It always points to main.m

2014-07-10 20:12:33.827 App[2936:60b] -[__NSArrayI length]: unrecognized selector sent to    instance 0xb766da0
2014-07-10 20:12:35.489 App[2936:60b] *** Terminating app due to uncaught exception    'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0xb766da0'
*** First throw call stack:
(
0   CoreFoundation                      0x035b61e4 __exceptionPreprocess + 180
1   libobjc.A.dylib                     0x018a28e5 objc_exception_throw + 44
2   CoreFoundation                      0x03653243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3   CoreFoundation                      0x035a650b ___forwarding___ + 1019
4   CoreFoundation                      0x035a60ee _CF_forwarding_prep_0 + 14
5   UIKit                               0x00512463 -[UILabel _shadow] + 45
6   UIKit                               0x005138c2 -[UILabel drawTextInRect:] + 70
7   UIKit                               0x00515dfc -[UILabel drawRect:] + 98
8   UIKit                               0x003c4453 -[UIView(CALayerDelegate) drawLayer:inContext:] + 504
9   QuartzCore                          0x02a8af39 -[CALayer drawInContext:] + 123
10  QuartzCore                          0x02a8ae6a _ZL16backing_callbackP9CGContextPv + 96
11  QuartzCore                          0x029794fc CABackingStoreUpdate_ + 2656
12  QuartzCore                          0x02a8ae02 ___ZN2CA5Layer8display_Ev_block_invoke + 93
13  QuartzCore                          0x02abf2d7 x_blame_allocations + 15
14  QuartzCore                          0x02a8ac6d _ZN2CA5Layer8display_Ev + 1519
15  QuartzCore                          0x02a8aeb9 -[CALayer _display] + 33
16  QuartzCore                          0x02a8a676 _ZN2CA5Layer7displayEv + 144
17  QuartzCore                          0x02a8ae93 -[CALayer display] + 33
18  QuartzCore                          0x02a7f043 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 323
19  QuartzCore                          0x02a7f0bc _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 38
20  QuartzCore                          0x029e57fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
21  QuartzCore                          0x029e6b85 _ZN2CA11Transaction6commitEv + 393
22  QuartzCore                          0x029e7258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
23  CoreFoundation                      0x0357e36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24  CoreFoundation                      0x0357e2bf __CFRunLoopDoObservers + 399
25  CoreFoundation                      0x0355c254 __CFRunLoopRun + 1076
26  CoreFoundation                      0x0355b9d3 CFRunLoopRunSpecific + 467
27  CoreFoundation                      0x0355b7eb CFRunLoopRunInMode + 123
28  GraphicsServices                    0x038135ee GSEventRunModal + 192
29  GraphicsServices                    0x0381342b GSEventRun + 104
30  UIKit                               0x00355f9b UIApplicationMain + 1225
31  App                      0x00002548 main + 94
32  libdyld.dylib                       0x01fe8701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

I have tried recreating the breakpoint leaving all options on default. The blue arrow is activated.

'Show disassembly when debugging' is unchecked.

What could be wrong here ?

Drew
  • 145
  • 7

2 Answers2

1

Check your build setting mode if it is in release mode then change it to debug mode.

Hussain Shabbir
  • 14,801
  • 5
  • 40
  • 56
0

If callstack does not tell you anything, try to turn on zombie objects for more detailed memory debug info. Yout can turn it on in menu 'Product -> Scheme -> Edit Scheme ...' than in left panel switch to 'Run $YourProjectName' and at the top panel switch to Diagnostics tab. There is an option under 'Menory Management' section 'Enable Zombie Objects' just turn it on. But be careful and when you find your bug turn it off again becouse these option cause diferent behaviour of memory alocations and releasing objects in memory and may cause an unexpected behaviour of your app.

Mysiaq
  • 555
  • 4
  • 13