1

Currently I am testing an almost finished App. In general it is working well.

But I have seen that the App is crashing (reproduceable, but at random times), when I change fast between a view controller that is using MapKit and CoreLocation and a plain one just displaying some simple buttons.

The crash happens after returning to the plain VC. Such fast changes are not the usual usage scenario of a user, I have done that just because testing is sooo boring ;-) - but now I know that there is an error somewhere.

Does anyone have an idea, where to look? See the error report from the device below - it looks always the same. The error messages in Xcode are different, but always something with unrecognized selector. Btw. I do not use performSelector:withObject: that must come from the framework.

I am tending to guess, that there are some internal initializing tasks from MKMapView or CoreLocation that are not finished when returning so fast from this VC and that these are causing the problem?

Error Message in Xcode:

2012-08-25 17:26:20.375 Kanal01[4070:707] -[__NSCFArray mapView:didUpdateUserLocation:]: unrecognized selector sent to instance 0x10b030
2012-08-25 17:26:20.384 Kanal01[4070:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray mapView:didUpdateUserLocation:]: unrecognized selector sent to instance 0x10b030'
*** First throw call stack: (0x374fa88f 0x351ff259 0x374fda9b 0x374fc915 0x37457650 0x36f13e63 0x374591fb 0x37495ab9 0x36f09b21 0x36badde3 0x36bad785 0x36ba7e4f 0x374ceb01 0x374ce12f 0x374cd351 0x374504a5 0x3745036d 0x33c0f439 0x311fccd5 0xa9eed 0xa9e88) terminate called throwing an exception

Content of Device Log:

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000
Crashed Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x36fe8f7e 0x36fe5000 + 16254
1 MapKit 0x337b9e5c 0x3378b000 + 192092
2 CoreFoundation 0x30c0f1f4 0x30bf7000 + 98804
3 CoreFoundation 0x30c4bab2 0x30bf7000 + 346802
4 MapKit 0x337afb1a 0x3378b000 + 150298
5 CoreLocation 0x33ccaddc 0x33cc2000 + 36316
6 CoreLocation 0x33cca77e 0x33cc2000 + 34686
7 CoreLocation 0x33cc4e48 0x33cc2000 + 11848
8 CoreFoundation 0x30c84afa 0x30bf7000 + 580346
9 CoreFoundation 0x30c84128 0x30bf7000 + 577832
10 CoreFoundation 0x30c8334a 0x30bf7000 + 574282
11 CoreFoundation 0x30c0649e 0x30bf7000 + 62622
12 CoreFoundation 0x30c06366 0x30bf7000 + 62310
13 GraphicsServices 0x32c80432 0x32c7c000 + 17458
14 UIKit 0x30369cce 0x30338000 + 203982
15 Kanal01 0x00069fde 0x68000 + 8158
16 Kanal01 0x00069f78 0x68000 + 8056

Andre
  • 51
  • 2
  • 2
    See http://stackoverflow.com/questions/2188098/why-am-i-crashing-after-mkmapview-is-freed-if-im-no-longer-using-it, http://stackoverflow.com/questions/10893808/exc-bad-access-when-switch-too-fast-between-an-tableview-and-a-mapview, and http://stackoverflow.com/questions/8568966/mkmapview-still-sending-messages-to-delegate-after-its-superview-has-been-de-al. Also see the last part of [this answer](http://stackoverflow.com/a/8403478/467105) suggesting to set/clear the map view's delegate in viewWillAppear/viewWillDisappear. –  Aug 25 '12 at 17:03
  • Great forum - that was the problem - thank you very much :-) - I did set the delegate for the locationManager to nil, but not the map delegate... – Andre Aug 25 '12 at 17:49

0 Answers0