App Crash on setRightButton. No idea why - ios

I trying to figure out why my App crashes sometimes on costumers devices. My App is from the AppStore. It happend not always, only in rare cases it seams.
Here is the used codeblock
[UIView animateWithDuration:0.3 animations:^(void){ [self.spinner setAlpha:0.0]; } completion:^(BOOL finished){
if(self.spinner != nil){
[self.spinner removeFromSuperview];
self.spinner = nil;
UIBarButtonItem *externButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:#selector(openBrowser)];
[self.navigationItem setRightBarButtonItem:externButton animated:YES];
}
}];
It crashes on setRightBarButtomItem:animated:. The codeblock is executed in an Background-Thread. Is that the Problem?
Here the crashlog:
Hardware Model: iPhone5,2
Process: [THE APP] [3052]
Path: (null)
Identifier: [THE APP]
Version: 3.9.0 (3.9.0)
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2013-11-09 16:07:04.000 +0100
OS Version: iPhone OS 7.0 (11A465)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x7000000c
Crashed Thread: 13
Thread 0:
0 CoreFoundation 0x30781224 __CFStringCreateImmutableFunnel3 + 1160
1 CoreFoundation 0x306dbf38 CFStringCreateWithBytes + 48
2 Foundation 0x310c49e8 -[NSPlaceholderString initWithBytes:length:encoding:] + 100
3 Foundation 0x310c4968 +[NSString stringWithUTF8String:] + 124
4 Foundation 0x310c48b0 NSStringFromClass + 128
5 UIKit 0x32fddb68 +[_UIAppearanceCustomizableClassInfo _customizableClassInfoForViewClass:withGuideClass:] + 260
6 UIKit 0x32fddd90 -[_UIAppearanceCustomizableClassInfo _superClassInfo] + 160
7 UIKit 0x32fddcc8 existingAppearancesNodesInNodeForClassAndSuperclasses + 136
8 UIKit 0x32fdd1d0 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:] + 164
9 UIKit 0x32fdd120 +[_UIAppearance _applyInvocationsTo:window:] + 24
10 UIKit 0x32f32488 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 176
11 QuartzCore 0x32bb9f40 -[CALayer layoutSublayers] + 140
12 QuartzCore 0x32bb5760 CA::Layer::layout_if_needed(CA::Transaction*) + 344
13 UIKit 0x32f47410 -[UIView(Hierarchy) layoutBelowIfNeeded] + 532
14 UIKit 0x32fe9810 -[UIBarButtonItem(UIStatic) _leftRightImagePaddingForEdgeMarginInNavBarIsMini:] + 360
15 UIKit 0x32fcf140 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:forItemAtIndex:returnedIdealWidthOfTextContent:availableLayoutWidthForTextContent:idealBackButtonWidth:] + 2504
16 UIKit 0x32fc6e38 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:forItemAtIndex:] + 632
17 UIKit 0x32fc6bb8 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:] + 136
18 UIKit 0x32fcd080 -[UINavigationBar _setLeftViews:rightViews:] + 1248
19 UIKit 0x32fca2b8 -[UINavigationBar _pushNavigationItem:transition:] + 464
20 UIKit 0x32fc9e98 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 148
21 UIKit 0x32fe13a0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 868
22 UIKit 0x32fe0fe8 -[UINavigationController __viewWillLayoutSubviews] + 44
23 UIKit 0x32fe0f78 -[UILayoutContainerView layoutSubviews] + 180
24 UIKit 0x32f32530 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 344
25 QuartzCore 0x32bb9f40 -[CALayer layoutSublayers] + 140
26 QuartzCore 0x32bb5760 CA::Layer::layout_if_needed(CA::Transaction*) + 344
27 QuartzCore 0x32bb55f8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
28 QuartzCore 0x32bb5008 CA::Context::commit_transaction(CA::Transaction*) + 224
29 QuartzCore 0x32bb4e18 CA::Transaction::commit() + 308
30 QuartzCore 0x32baeb48 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 52
31 CoreFoundation 0x30777f70 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
32 CoreFoundation 0x307758f8 __CFRunLoopDoObservers + 280
33 CoreFoundation 0x30775c48 __CFRunLoopRun + 736
34 CoreFoundation 0x306e0540 CFRunLoopRunSpecific + 524
35 CoreFoundation 0x306e0320 CFRunLoopRunInMode + 104
36 GraphicsServices 0x354172e8 GSEventRunModal + 136
37 UIKit 0x32f971e0 UIApplicationMain + 1132
38 [THE APP] 0x00059f48 main (main.m:21)
Thread 1:
0 libsystem_kernel.dylib 0x3b043838 kevent64 + 24
1 libdispatch.dylib 0x3af8c640 _dispatch_mgr_thread + 36
Thread 2:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 3:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 4:
0 libsystem_kernel.dylib 0x3b043a84 mach_msg_trap + 20
1 CoreFoundation 0x30777560 __CFRunLoopServiceMachPort + 156
2 CoreFoundation 0x30775c80 __CFRunLoopRun + 792
3 CoreFoundation 0x306e0540 CFRunLoopRunSpecific + 524
4 CoreFoundation 0x306e0320 CFRunLoopRunInMode + 104
5 Foundation 0x3111b650 +[NSURLConnection(Loader) _resourceLoadLoop:] + 320
6 Foundation 0x31190dc0 __NSThread__main__ + 1056
7 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
8 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 5:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 6:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 7:
0 libsystem_kernel.dylib 0x3b056550 __semwait_signal + 24
1 Foundation 0x311904d8 +[NSThread sleepForTimeInterval:] + 144
2 [THE APP] 0x0014a870 -[KSCrashDeadlockMonitor runMonitor] + 232
3 Foundation 0x31190dc0 __NSThread__main__ + 1056
4 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
5 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 8:
0 libsystem_kernel.dylib 0x3b043a84 mach_msg_trap + 20
1 [THE APP] 0x001469e0 ksmachexc_i_handleExceptions + 128
2 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
3 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 9:
Thread 10:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x3b056440 select$DARWIN_EXTSN + 20
1 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
2 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 12:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 13 Crashed:
0 libobjc.A.dylib 0x3aaa1b66 objc_msgSend + 6
1 UIKit 0x32fe4b80 -[UINavigationItem updateNavigationBarButtonsAnimated:] + 156
2 UIKit 0x32fe46e8 -[UINavigationItem setRightBarButtonItem:animated:] + 156
3 [THE APP] 0x000c6058 -[ProductViewController loadXML] (ProductViewController.m:978)
4 Foundation 0x31190dc0 __NSThread__main__ + 1056
5 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
6 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 13 crashed with ARM Thread State:
r0: 0x15e78c40 r1: 0x33517435 r2: 0x00000000 r3: 0x00000000
r4: 0x33517435 r5: 0x33530ea0 r6: 0x15e83b00 r7: 0x037a2be0
r8: 0x15d56570 r9: 0x70000000 r10: 0x00000000 r11: 0x00000001
ip: 0x3b5be224 sp: 0x037a27f0 lr: 0x32fccffb pc: 0x3aaa1b66
cpsr: 0x20000030
Binary Images:
[cut cause of char limit]
Any ideas? Thanks for the help!

First of all you shouldn't run this in a background thread.
Secondly BAD_ACCESS usually happens when you over-release something.
I can't figure out where you over-release but maybe you can find it in your code. my guess is the navigation item tries to release something before setting your externButton...
EDIT: where is this code happening at? could be that the UIViewController isn't pushed anymore into the navigation controller or not the top one by the time this code is executed?

Things that update the UI should be on the main thread.
dispatch_async(dispatch_get_main_queue(), ^{ /* UI code goes here */ });

Related

App crashes on start on real device only

I wanted to publish my game app today(using Swift - xCode GTM and Sprite kit framework). My app works fine on the simulator but when I tried it on a real device - iPhone 4 iOS 7, it crashes on start:
class func unarchiveFromFile(file : NSString) -> SKNode? {
let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks")//CRASH!
var sceneData = NSData.dataWithContentsOfFile(path!, options: .DataReadingMappedIfSafe, error: nil)
var archiver = NSKeyedUnarchiver(forReadingWithData: sceneData)
archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as GameScene
archiver.finishDecoding()
return scene
}
}
here is my Crash log:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000000000defe
Triggered by Thread: 0
Thread 0 Crashed:
0 libswiftCore.dylib 0x003347d0 0x1b6000 + 1566672
1 libswiftCore.dylib 0x001f3a64 0x1b6000 + 252516
2 MyApp 0x000d2904 0xc4000 + 59652
3 MyApp 0x000d36d8 0xc4000 + 63192
4 MyApp 0x000d4214 0xc4000 + 66068
5 MyApp 0x000d4dc4 0xc4000 + 69060
6 UIKit 0x3079e5fe -[UIViewController loadViewIfRequired] + 514
7 UIKit 0x3079e3bc -[UIViewController view] + 20
8 UIKit 0x307a5088 -[UIWindow addRootViewControllerViewIfPossible] + 60
9 UIKit 0x307a275e -[UIWindow _setHidden:forced:] + 302
10 UIKit 0x3080da50 -[UIWindow makeKeyAndVisible] + 56
11 UIKit 0x3080a80c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1652
12 UIKit 0x30804d0e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 710
13 UIKit 0x3079f6a2 -[UIApplication handleEvent:withNewEvent:] + 3126
14 UIKit 0x3079e9a4 -[UIApplication sendEvent:] + 68
15 UIKit 0x308044f8 _UIApplicationHandleEvent + 660
16 GraphicsServices 0x32c3670a _PurpleEventCallback + 606
17 GraphicsServices 0x32c362f2 PurpleEventCallback + 30
18 CoreFoundation 0x2dff39e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
19 CoreFoundation 0x2dff397e __CFRunLoopDoSource1 + 342
20 CoreFoundation 0x2dff2152 __CFRunLoopRun + 1394
21 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
22 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
23 UIKit 0x30803794 -[UIApplication _run] + 756
24 UIKit 0x307fea3c UIApplicationMain + 1132
25 MyApp 0x000da594 0xc4000 + 91540
26 MyApp 0x000da5d0 0xc4000 + 91600
27 libdyld.dylib 0x38858ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x388fc83c kevent64 + 24
1 libdispatch.dylib 0x38847e08 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x388373ee _dispatch_mgr_thread$VARIANT$up + 34
Thread 2:
0 libsystem_kernel.dylib 0x3890fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38975dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38975c80 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x3890fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38975dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38975c80 start_wqthread + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x3890efa8 __psynch_mutexwait + 24
1 libsystem_pthread.dylib 0x38975f0a _pthread_mutex_lock + 302
2 WebCore 0x35e2f138 _WebTryThreadLock(bool) + 104
3 WebCore 0x35e2f0ba WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 42
4 CoreFoundation 0x2dff41d2 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
5 CoreFoundation 0x2dff1b74 __CFRunLoopDoObservers + 280
6 CoreFoundation 0x2dff1f84 __CFRunLoopRun + 932
7 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
8 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
9 WebCore 0x35e2dbae RunWebThread(void*) + 414
10 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
11 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
12 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x388fca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x388fc888 mach_msg + 44
2 CoreFoundation 0x2dff37c6 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2dff1eec __CFRunLoopRun + 780
4 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
6 Foundation 0x2e996492 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2ea0be22 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x388fca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x388fc888 mach_msg + 44
2 CoreFoundation 0x2dff37c6 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2dff1eec __CFRunLoopRun + 780
4 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2cfe1584 GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2cfd5a94 CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 7:
0 libsystem_kernel.dylib 0x3890fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38975dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38975c80 start_wqthread + 4
Thread 8 name: JavaScriptCore::BlockFree
Thread 8:
0 libsystem_kernel.dylib 0x3890ef38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38977224 _pthread_cond_wait + 536
2 libsystem_pthread.dylib 0x38978040 pthread_cond_timedwait + 40
3 JavaScriptCore 0x2ef80eb8 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 104
4 JavaScriptCore 0x2ef80ce4 JSC::BlockAllocator::blockFreeingThreadMain() + 88
5 JavaScriptCore 0x2ef7e3a8 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
7 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
8 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00362ac4 r3: 0x000000b6
r4: 0x00362ac4 r5: 0x00000000 r6: 0x145c97b0 r7: 0x27d3d364
r8: 0x1456eb50 r9: 0x00000fff r10: 0x145c97b0 r11: 0x00362ac0
ip: 0x3a5431d0 sp: 0x27d3d354 lr: 0x00334183 pc: 0x003347d0
cpsr: 0x60000030
The pathForResource() function returns a String?, indicating that (because it's an optional) there's a chance no value will be returned. I'm guessing the method is returning nil, but because you're assigning it using a let statement, the app is crashing.
I'm a little surprised it's crashing directly on that line though. You should be able to assign nil using the let keyword. In any case, if the value is nil, you'd definitely encounter a crash on your next line when you force unwrap the optional:
var sceneData = NSData.dataWithContentsOfFile(path!, options: .DataReadingMappedIfSafe, error: nil)
^ here
Try this:
if let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks") {
/* ... (your code using path) ... */
} else {
NSLog("Unable to locate path for resource: \(file)")
}
I have a feeling you'll see that NSLog() output at launch.

ios app crashes for only one customer

One of my customers reports consistent crashing, about 75% of the times he performs a particular operation in the app. That operation involves some image processing. He's using an iPhone 4S (the same model I used when developing the app) and iOS 7.1.1. No other customer has reported this issue. He has deleted the app and reinstalled from the App Store. He's using the app's default settings. I cannot recreate the issue.
Thread 8 crashes, but does not show any lines in my code ("gCard"). The issue appears to be "doesNotRecognizeSelector:" in a thread that does not show any lines in my code. I don't understand this. (The app uses brad Larson's GPUImage but I don't know if that's a factor.)
I need help to understand the dump and suggestions on my next step.
{"name":"gCard","bug_type":"109","os_version":"iPhone OS 7.1.1 (11D201)","bundleID":"com.PFM3.Ghost-Card","version":"1.2.1 (1.2.1)","app_name":"gCard"}
Incident Identifier: E85F86F8-0F39-4E55-9EAD-48461F1EF955
CrashReporter Key: 64c031d9f1572910e1137bebea2b9be924396928
Hardware Model: iPhone4,1
Process: gCard [136]
Path: /var/mobile/Applications/4E5D5D22-0202-47DE-B8B2-B9C9D90825B2/gCard.app/gCard
Identifier: com.PFM3.Ghost-Card
Version: 1.2.1 (1.2.1)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-06-23 00:03:18.728 -0700
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000000000defe
Triggered by Thread: 8
Last Exception Backtrace:
0 CoreFoundation 0x2ec27fce __exceptionPreprocess + 126
1 libobjc.A.dylib 0x394a0cca objc_exception_throw + 34
2 CoreFoundation 0x2ec2b962 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198
3 CoreFoundation 0x2ec2a24e ___forwarding___ + 702
4 CoreFoundation 0x2eb797b4 _CF_forwarding_prep_0 + 20
5 UIFoundation 0x36865a20 __NSStringDrawingEngine + 12200
6 UIFoundation 0x368629a2 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 146
7 UIKit 0x3145cd1c -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4220
8 UIKit 0x314c3004 -[UILabel drawTextInRect:] + 496
9 UIKit 0x314c2e06 -[UILabel drawRect:] + 74
10 UIKit 0x314c2da0 -[UIView(CALayerDelegate) drawLayer:inContext:] + 368
11 QuartzCore 0x310f02bc -[CALayer drawInContext:] + 96
12 QuartzCore 0x310d9e3a CABackingStoreUpdate_ + 1850
13 QuartzCore 0x311b4d68 ___ZN2CA5Layer8display_Ev_block_invoke + 48
14 QuartzCore 0x310d96ee x_blame_allocations + 78
15 QuartzCore 0x310d9396 CA::Layer::display_() + 1102
16 QuartzCore 0x310bd038 CA::Layer::display_if_needed(CA::Transaction*) + 204
17 QuartzCore 0x310bccd0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 20
18 QuartzCore 0x310bc6da CA::Context::commit_transaction(CA::Transaction*) + 226
19 QuartzCore 0x310bc4ea CA::Transaction::commit() + 310
20 QuartzCore 0x310e9a7e CA::Transaction::release_thread(void*) + 158
21 libsystem_pthread.dylib 0x39acb688 _pthread_tsd_cleanup + 160
22 libsystem_pthread.dylib 0x39acb406 _pthread_exit + 82
23 libsystem_pthread.dylib 0x39acabe2 _pthread_wqthread + 314
24 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 0:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf1002 __CFRunLoopRun + 850
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb5bcee CFRunLoopRunInMode + 102
6 GraphicsServices 0x33ab465e GSEventRunModal + 134
7 UIKit 0x314a7168 UIApplicationMain + 1132
8 gCard 0x00089e12 main (main.m:16)
9 libdyld.dylib 0x399adab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x39a50808 kevent64 + 24
1 libdispatch.dylib 0x39992078 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x39991dfe _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf0fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb5bcee CFRunLoopRunInMode + 102
6 Foundation 0x2f54e1e6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x2f59f09c -[NSRunLoop(NSRunLoop) run] + 76
8 gCard 0x000cd8d4 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:151)
9 Foundation 0x2f610a5a __NSThread__main__ + 1058
10 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
11 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
12 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf0fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb9f9fe CFRunLoopRun + 94
6 CoreMotion 0x2f2193a8 ___lldb_unnamed_function1423$$CoreMotion + 724
7 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
8 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
9 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf0fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb5bcee CFRunLoopRunInMode + 102
6 Foundation 0x2f59b082 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2f610a5a __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
9 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
10 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 5 name: com.apple.CFSocket.private
Thread 5:
0 libsystem_kernel.dylib 0x39a63434 __select + 20
1 CoreFoundation 0x2ebf6758 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
3 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
4 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x39a63c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x39acabda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x39a63c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x39acabda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 8 Crashed:
0 libsystem_c.dylib 0x39a1404e __abort + 102
1 libsystem_c.dylib 0x39a13fe4 abort + 84
2 libc++abi.dylib 0x38d42cd2 abort_message + 70
3 libc++abi.dylib 0x38d5b6e0 default_terminate_handler() + 248
4 libobjc.A.dylib 0x394a0f62 _objc_terminate() + 190
5 libc++abi.dylib 0x38d591c4 std::__terminate(void (*)()) + 76
6 libc++abi.dylib 0x38d58a18 __cxa_throw + 112
7 libobjc.A.dylib 0x394a0d9e objc_exception_throw + 246
8 CoreFoundation 0x2ec2b962 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198
9 CoreFoundation 0x2ec2a24e ___forwarding___ + 702
10 CoreFoundation 0x2eb797b4 _CF_forwarding_prep_0 + 20
11 UIFoundation 0x36865a20 __NSStringDrawingEngine + 12200
12 UIFoundation 0x368629a2 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 146
13 UIKit 0x3145cd1c -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4220
14 UIKit 0x314c3004 -[UILabel drawTextInRect:] + 496
15 UIKit 0x314c2e06 -[UILabel drawRect:] + 74
16 UIKit 0x314c2da0 -[UIView(CALayerDelegate) drawLayer:inContext:] + 368
17 QuartzCore 0x310f02bc -[CALayer drawInContext:] + 96
18 QuartzCore 0x310d9e3c CABackingStoreUpdate_ + 1852
19 QuartzCore 0x311b4d68 ___ZN2CA5Layer8display_Ev_block_invoke + 48
20 QuartzCore 0x310d96f0 x_blame_allocations + 80
21 QuartzCore 0x310d9396 CA::Layer::display_() + 1102
22 QuartzCore 0x310bd038 CA::Layer::display_if_needed(CA::Transaction*) + 204
23 QuartzCore 0x310bccd0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 20
24 QuartzCore 0x310bc6da CA::Context::commit_transaction(CA::Transaction*) + 226
25 QuartzCore 0x310bc4ea CA::Transaction::commit() + 310
26 QuartzCore 0x310e9a7e CA::Transaction::release_thread(void*) + 158
27 libsystem_pthread.dylib 0x39acb68a _pthread_tsd_cleanup + 162
28 libsystem_pthread.dylib 0x39acb406 _pthread_exit + 82
29 libsystem_pthread.dylib 0x39acabe2 _pthread_wqthread + 314
30 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 8 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00000001
r4: 0x06277c84 r5: 0xffffffff r6: 0x00000000 r7: 0x06277c94
r8: 0x1767ed40 r9: 0x39ac7f69 r10: 0x368b94c8 r11: 0x00000000
ip: 0x00000030 sp: 0x06277c7c lr: 0x39a1404f pc: 0x39a1404e
cpsr: 0x40000030
You should/must do all( or nearly all) ui specific operations on the main thread. Possibly you alter the view hierarchy in a block performed on another block.

Crash Report - iOS - View Controller Related?

Can anyone help me understand a crash report? This is the first time I have ever had to deal with one since iOS App developing in 8 months.
I know it is something to do with dismissing a view controller that is causing it, but I have made no changes to the code regarding this but all of a sudden it is starting to cause problems. Any guidance on where to start would be amazing.
Date/Time: 2013-03-10 14:56:06.091 +0000
OS Version: iOS 6.1.2 (10B146)
Report Version: 104
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 0x3afee5b6 objc_msgSend + 22
1 AVFoundation 0x3247f752 -[AVAudioPlayer(AVAudioPlayerPriv) finishedPlaying:] + 74
2 Foundation 0x33c700f0 __NSThreadPerformPerform + 456
3 CoreFoundation 0x3332e680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
4 CoreFoundation 0x3332dee4 __CFRunLoopDoSources0 + 208
5 CoreFoundation 0x3332ccb2 __CFRunLoopRun + 642
6 CoreFoundation 0x3329feb8 CFRunLoopRunSpecific + 352
7 CoreFoundation 0x3329fd44 CFRunLoopRunInMode + 100
8 GraphicsServices 0x36e612e6 GSEventRunModal + 70
9 UIKit 0x351b52fc UIApplicationMain + 1116
10 iWhovian 0x000391fe main (main.m:15)
11 iWhovian 0x0002f56c start + 36
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3b4e1648 kevent64 + 24
1 libdispatch.dylib 0x3b41a4ec _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x3b40cdf4 _dispatch_mgr_thread$VARIANT$up + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x3b4e0eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b4e1048 mach_msg + 36
2 CoreFoundation 0x3332e040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x3332cd9e __CFRunLoopRun + 878
4 CoreFoundation 0x3329feb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3329fd44 CFRunLoopRunInMode + 100
6 WebCore 0x39294500 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x3b44a30e _pthread_start + 306
8 libsystem_c.dylib 0x3b44a1d4 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x3b4f108c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3b442d2a _pthread_cond_wait + 642
2 libsystem_c.dylib 0x3b44cf14 pthread_cond_wait + 36
3 Foundation 0x33bec4d2 -[NSCondition wait] + 190
4 iWhovian 0x0006ef90 -[PFCommandCache runLoop] (PFCommandCache.m:491)
5 Foundation 0x33c6fe80 __NSThread__main__ + 968
6 libsystem_c.dylib 0x3b44a30e _pthread_start + 306
7 libsystem_c.dylib 0x3b44a1d4 thread_start + 4
Thread 4 name: AQClient
Thread 4:
0 libsystem_kernel.dylib 0x3b4e0eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b4e1048 mach_msg + 36
2 CoreFoundation 0x3332e040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x3332cd9e __CFRunLoopRun + 878
4 CoreFoundation 0x3329feb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3329fd44 CFRunLoopRunInMode + 100
6 AudioToolbox 0x32d816fe GenericRunLoopThread::Entry(void*) + 134
7 AudioToolbox 0x32d62882 CAPThread::Entry(CAPThread*) + 294
8 libsystem_c.dylib 0x3b44a30e _pthread_start + 306
9 libsystem_c.dylib 0x3b44a1d4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x3b4f1d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3b43fcf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3b43fa12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3b43f8a0 start_wqthread + 4
Thread 6 name: Dispatch queue: com.apple.NSXPCConnection.m-user.com.apple.gamed
Thread 6:
0 libobjc.A.dylib 0x3afee5b0 objc_msgSend + 16
1 CoreFoundation 0x332b0fdc -[__NSSetI member:] + 140
2 CoreFoundation 0x332b0f44 -[NSSet containsObject:] + 28
3 Foundation 0x33c08978 -[NSCoder _validateAllowedClass:forKey:allowingInvocations:] + 124
4 Foundation 0x33c08402 _decodeObjectStuff + 282
5 Foundation 0x33c08200 -[NSXPCDecoder decodeObjectOfClasses:forKey:] + 76
6 GameKit 0x33e2f8fa -[GKInternalRepresentation initWithCoder:] + 238
7 Foundation 0x33c086f2 _decodeObjectStuff + 1034
8 Foundation 0x33d1fda8 -[NSXPCDecoder _decodeArrayOfObjectsForKey:] + 532
9 Foundation 0x33bf4ebc -[NSArray(NSArray) initWithCoder:] + 784
10 Foundation 0x33c086f2 _decodeObjectStuff + 1034
11 Foundation 0x33c08200 -[NSXPCDecoder decodeObjectOfClasses:forKey:] + 76
12 GameKit 0x33e2f8fa -[GKInternalRepresentation initWithCoder:] + 238
13 Foundation 0x33c086f2 _decodeObjectStuff + 1034
14 Foundation 0x33c08200 -[NSXPCDecoder decodeObjectOfClasses:forKey:] + 76
15 Foundation 0x33c09fe8 _walkAndDecodeData + 1708
16 Foundation 0x33c0988c decodeInvocationArguments + 1368
17 Foundation 0x33c08fc8 -[NSXPCDecoder decodeInvocation] + 860
18 Foundation 0x33c08630 _decodeObjectStuff + 840
19 Foundation 0x33c08200 -[NSXPCDecoder decodeObjectOfClasses:forKey:] + 76
20 Foundation 0x33c07c04 -[NSXPCConnection _decodeAndInvokeReplyBlockWithData:] + 548
21 Foundation 0x33d1eedc __message_handler_block_invoke_0 + 32
22 libdispatch.dylib 0x3b40b11c _dispatch_call_block_and_release + 8
23 libdispatch.dylib 0x3b40a996 _dispatch_queue_drain$VARIANT$up + 142
24 libdispatch.dylib 0x3b40a890 _dispatch_queue_invoke$VARIANT$up + 32
25 libdispatch.dylib 0x3b419212 _dispatch_root_queue_drain + 190
26 libdispatch.dylib 0x3b4193b4 _dispatch_worker_thread2 + 80
27 libsystem_c.dylib 0x3b43fa0e _pthread_wqthread + 358
28 libsystem_c.dylib 0x3b43f8a0 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x3b4f1d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3b43fcf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3b43fa12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3b43f8a0 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x208a4ef0 r1: 0x38e042ae r2: 0x33f0ac6c r3: 0x00000008
r4: 0x20747372 r5: 0x2089ac70 r6: 0x33f0ac6c r7: 0x2fdd2df8
r8: 0x3b667530 r9: 0x0e3810ab r10: 0x00000000 r11: 0x1fd4dd90
ip: 0x3b5734ac sp: 0x2fdd2de0 lr: 0x3247f757 pc: 0x3afee5b6
cpsr: 0x20070030
I ran into this one a while ago. The problem can be fixed by setting the AVAudioPlayer instance's delegate to nil in your view controller's dealloc method. Unless you do this, the audio player tries to make one last call to its delegate to let it know that is is done playing. But if the delegate has been deallocated, you get this crash.
- (void)dealloc {
_myPlayer.delegate = nil; // _myPlayer is your AVAudioPlayer instance
[super dealloc]; // Only is you are not using ARC
}
You're most likely trying to access an object, that hast been deallocated. Have a look at
Debugging EXC_BAD_ACCESS Error in Xcode using Instruments (Archived)
to see how you can track it down.

MKMapView crashes by setRegion

i want to show a specific adress on the Map. Here is my code.
- (void)viewDidLoad{
[super viewDidLoad];
CLLocationCoordinate2D startCoord = CLLocationCoordinate2DMake(51.514302, 7.616798);
MKCoordinateRegion adjustedRegion = [_map regionThatFits:MKCoordinateRegionMakeWithDistance(startCoord, 200.0, 200.0)];
adjustedRegion.span = MKCoordinateSpanMake(0.005, 0.005);
[_map setRegion:adjustedRegion];
On the Simulator it works fine but on my iPad it crashes...
Where is my fault?
Last Exception Backtrace:
0 CoreFoundation 0x33cbe3e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3bb4e95e objc_exception_throw + 26
2 CoreFoundation 0x33cbe0d0 -[NSException raise] + 4
3 MapKit 0x34aec530 -[MKMapView setRegion:animated:] + 672
4 MapKit 0x34aec64a __32-[MKMapView setRegion:animated:]_block_invoke_0 + 90
5 MapKit 0x34ad6006 -[MKMapView _updateCenteredAttributesWithCoordinate:] + 122
6 MapKit 0x34ad5f3a -[MKMapView _sizeDidChangeWithCenterCoordinate:] + 126
7 MapKit 0x34ae8b58 -[MKMapView setBounds:] + 224
8 UIKit 0x35cb2476 -[UIView(Geometry) _applyISEngineLayoutValues] + 246
9 UIKit 0x35b3068a -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 138
10 CoreFoundation 0x33cb9c1c __NSArrayChunkIterate + 364
11 CoreFoundation 0x33cb2bb2 __NSArrayEnumerate + 590
12 CoreFoundation 0x33c14e32 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
13 UIKit 0x35ae9096 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114
14 UIKit 0x35f09da8 -[UIView(AdditionalLayoutSupport) _is_layout] + 112
15 UIKit 0x35ad6ae0 -[UIView(Hierarchy) layoutSubviews] + 68
16 UIKit 0x35ad08c2 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
17 QuartzCore 0x3587c50e -[CALayer layoutSublayers] + 210
18 QuartzCore 0x3587c0b0 CA::Layer::layout_if_needed(CA::Transaction*) + 456
19 QuartzCore 0x358aaeca -[CALayer layoutIfNeeded] + 138
20 UIKit 0x35b7a0dc -[UIViewController window:setupWithInterfaceOrientation:] + 204
21 UIKit 0x35b792c6 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3598
22 UIKit 0x35b784aa -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42
23 UIKit 0x35b78434 -[UIWindow _setRotatableViewOrientation:duration:force:] + 64
24 UIKit 0x35cadcb4 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 100
25 UIKit 0x35b3667e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 214
26 UIKit 0x35b363c2 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 690
27 UIKit 0x35b35d2a -[UIViewController _tryBecomeRootViewControllerInWindow:] + 150
28 UIKit 0x35b2ce86 -[UIWindow addRootViewControllerViewIfPossible] + 366
29 UIKit 0x35b28af0 -[UIWindow _setHidden:forced:] + 360
30 UIKit 0x35b6a1dc -[UIWindow makeKeyAndVisible] + 56
31 UIKit 0x35b2d7fe -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1642
32 UIKit 0x35b2582e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
33 UIKit 0x35acdd1a -[UIApplication handleEvent:withNewEvent:] + 1006
34 UIKit 0x35acd7a8 -[UIApplication sendEvent:] + 68
35 UIKit 0x35acd1ea _UIApplicationHandleEvent + 6194
36 GraphicsServices 0x377c05f2 _PurpleEventCallback + 586
37 GraphicsServices 0x377c0222 PurpleEventCallback + 30
38 CoreFoundation 0x33c933e2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30
39 CoreFoundation 0x33c93386 __CFRunLoopDoSource1 + 134
40 CoreFoundation 0x33c9220a __CFRunLoopRun + 1378
41 CoreFoundation 0x33c05238 CFRunLoopRunSpecific + 352
42 CoreFoundation 0x33c050c4 CFRunLoopRunInMode + 100
43 UIKit 0x35b24468 -[UIApplication _run] + 664
44 UIKit 0x35b212b4 UIApplicationMain + 1116
45 AD HOK 0x000bcd80 main (main.m:16)
46 libdyld.dylib 0x3bf7bb1c start + 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3c042350 __pthread_kill + 8
1 libsystem_c.dylib 0x3bfb8fb2 pthread_kill + 54
2 libsystem_c.dylib 0x3bff5366 abort + 90
3 libc++abi.dylib 0x3b59ddda abort_message + 70
4 libc++abi.dylib 0x3b59b094 _ZL17default_terminatev + 20
5 libobjc.A.dylib 0x3bb4ea58 _ZL15_objc_terminatev + 144
6 libc++abi.dylib 0x3b59b118 _ZL19safe_handler_callerPFvvE + 76
7 libc++abi.dylib 0x3b59b1b0 std::terminate() + 16
8 libc++abi.dylib 0x3b59c626 __cxa_rethrow + 90
9 libobjc.A.dylib 0x3bb4e9b0 objc_exception_rethrow + 8
10 CoreFoundation 0x33c0529c CFRunLoopRunSpecific + 452
11 CoreFoundation 0x33c050c4 CFRunLoopRunInMode + 100
12 UIKit 0x35b24468 -[UIApplication _run] + 664
13 UIKit 0x35b212b4 UIApplicationMain + 1116
14 AD HOK 0x000bcd80 main (main.m:16)
15 libdyld.dylib 0x3bf7bb1c start + 0
Thread 1:
0 libsystem_kernel.dylib 0x3c042d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bf90ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bf907f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bf90680 start_wqthread + 4
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x3c0325d0 kevent64 + 24
1 libdispatch.dylib 0x3bf6dd22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x3bf69374 _dispatch_mgr_thread + 32
Thread 3:
0 libsystem_kernel.dylib 0x3c042d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bf90ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bf907f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bf90680 start_wqthread + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x3c031e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c031fd0 mach_msg + 48
2 CoreFoundation 0x33c932b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x33c9202c __CFRunLoopRun + 900
4 CoreFoundation 0x33c05238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33c050c4 CFRunLoopRunInMode + 100
6 WebCore 0x39be0390 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3bf9b0de _pthread_start + 306
8 libsystem_c.dylib 0x3bf9afa4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x3c042d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bf90ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bf907f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bf90680 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3db31524
r4: 0x00000006 r5: 0x3db31b78 r6: 0x210aa354 r7: 0x2fd459d4
r8: 0x210aa330 r9: 0x00000300 r10: 0x00000000 r11: 0x7ff80000
ip: 0x00000148 sp: 0x2fd459c8 lr: 0x3bfb8fb7 pc: 0x3c042350
cpsr: 0x00000010
It's not clear why you are asking the map for the region that fits, when you end up setting the span for that region again explicitly anyway. Further, the map doesn't have a meaningful answer to this question before layout is completed. This is probably why it is crashing, because the region is not correctly defined.
From your code, it looks like you just wanted to do this:
- (void)viewDidLoad{
[super viewDidLoad];
CLLocationCoordinate2D startCoord = CLLocationCoordinate2DMake(51.514302, 7.616798);
[_map setRegion:MKCoordinateRegionMakeWithDistance(startCoord, 200.0, 200.0) animated:NO];
}
I think that's much simpler, and should work fine on the device. Hope that helps.

App Store crash report

My app got rejected from store and saying it's crashing. But we cannot reproduce the crash, not with simulator nor the devices. And looking at the crash report doesn't mean much. Any help or tips would be greatly appreciated. Here's the first crash report:
Date/Time: 2011-04-28 19:14:10.181 -0700
OS Version: iPhone OS 4.3.2 (8H7)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x624f7473
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x33b2b72a prepareForMethodLookup + 10
1 libobjc.A.dylib 0x33b27876 lookUpMethod + 34
2 libobjc.A.dylib 0x33b24ffa _class_lookupMethodAndLoadCache + 6
3 libobjc.A.dylib 0x33b24ce4 objc_msgSend_uncached + 20
4 UIKit 0x358b5ec2 -[UIApplication sendAction:to:from:forEvent:] + 78
5 UIKit 0x358b5e62 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
6 UIKit 0x358b5e34 -[UIControl sendAction:to:forEvent:] + 32
7 UIKit 0x358b5b86 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350
8 UIKit 0x358b641c -[UIControl touchesEnded:withEvent:] + 336
9 UIKit 0x3589b52e _UIGestureRecognizerSortAndSendDelayedTouches + 2194
10 UIKit 0x3589abfa _UIGestureRecognizerUpdateObserver + 690
11 CoreFoundation 0x3039ca2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10
12 CoreFoundation 0x3039e45e __CFRunLoopDoObservers + 406
13 CoreFoundation 0x3039f754 __CFRunLoopRun + 848
14 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
15 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
16 GraphicsServices 0x35571418 GSEventRunModal + 108
17 GraphicsServices 0x355714c4 GSEventRun + 56
18 UIKit 0x358c7d62 -[UIApplication _run] + 398
19 UIKit 0x358c5800 UIApplicationMain + 664
20 MyApp 0x0000206e main (main.m:14)
21 MyApp 0x00002038 0x1000 + 4152
Thread 1:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x36100fbc kevent + 24
1 libdispatch.dylib 0x33d0b032 _dispatch_mgr_invoke + 706
2 libdispatch.dylib 0x33d0c03a _dispatch_queue_invoke + 86
3 libdispatch.dylib 0x33d0b5ea _dispatch_worker_thread2 + 186
4 libsystem_c.dylib 0x33e0a58a _pthread_wqthread + 258
5 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 WebCore 0x34c2627e RunWebThread(void*) + 382
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 5 name: com.apple.coremedia.player.async
Thread 5:
0 libsystem_kernel.dylib 0x360ffd18 __semwait_signal + 24
1 libsystem_c.dylib 0x33e30860 _pthread_cond_wait + 756
2 libsystem_c.dylib 0x33dd7eb2 pthread_cond_wait + 26
3 CoreMedia 0x3661d8f4 WaitOnCondition + 4
4 CoreMedia 0x3661d83a FigSemaphoreWaitRelative + 66
5 MediaToolbox 0x324a9a64 fpa_AsyncMovieControlThread + 48
6 CoreMedia 0x3663b4dc figThreadMain + 156
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x3662562e r1: 0x3665003c r2: 0x00000001 r3: 0x624f7473
r4: 0x001aa690 r5: 0x3662562e r6: 0x00000001 r7: 0x2fdfe57c
r8: 0x3662562e r9: 0x3edb2a18 r10: 0x001c36c0 r11: 0x001c36c0
ip: 0x345b6ff5 sp: 0x2fdfe570 lr: 0x345b987d pc: 0x345bd72a
cpsr: 0x600f0030
And the 2nd one:
Date/Time: 2011-04-28 19:14:03.591 -0700
OS Version: iPhone OS 4.3.2 (8H7)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x360ffa1c __pthread_kill + 8
1 libsystem_c.dylib 0x33e093b4 pthread_kill + 52
2 libsystem_c.dylib 0x33e01bf8 abort + 72
3 libstdc++.6.dylib 0x363fca64 __gnu_cxx::__verbose_terminate_handler() + 376
4 libobjc.A.dylib 0x33b2806c _objc_terminate + 104
5 libstdc++.6.dylib 0x363fae36 __cxxabiv1::__terminate(void (*)()) + 46
6 libstdc++.6.dylib 0x363fae8a std::terminate() + 10
7 libstdc++.6.dylib 0x363faf5a __cxa_throw + 78
8 libobjc.A.dylib 0x33b26c84 objc_exception_throw + 64
9 CoreFoundation 0x303c91b8 -[NSObject(NSObject) doesNotRecognizeSelector:] + 96
10 CoreFoundation 0x303c8642 ___forwarding___ + 502
11 CoreFoundation 0x3033f178 _CF_forwarding_prep_0 + 40
12 CoreFoundation 0x3033556a -[NSObject(NSObject) performSelector:withObject:withObject:] + 18
13 UIKit 0x358b5ec2 -[UIApplication sendAction:to:from:forEvent:] + 78
14 UIKit 0x358b5e62 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
15 UIKit 0x358b5e34 -[UIControl sendAction:to:forEvent:] + 32
16 UIKit 0x358b5b86 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350
17 UIKit 0x358b5834 -[UIControl touchesBegan:withEvent:] + 180
18 UIKit 0x358b4baa -[UIWindow _sendTouchesForEvent:] + 294
19 UIKit 0x358b4568 -[UIWindow sendEvent:] + 256
20 UIKit 0x3589d30c -[UIApplication sendEvent:] + 292
21 UIKit 0x3589cc4c _UIApplicationHandleEvent + 5084
22 GraphicsServices 0x35571e70 PurpleEventCallback + 660
23 CoreFoundation 0x3039ca90 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
24 CoreFoundation 0x3039e838 __CFRunLoopDoSource1 + 160
25 CoreFoundation 0x3039f606 __CFRunLoopRun + 514
26 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
27 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
28 GraphicsServices 0x35571418 GSEventRunModal + 108
29 GraphicsServices 0x355714c4 GSEventRun + 56
30 UIKit 0x358c7d62 -[UIApplication _run] + 398
31 UIKit 0x358c5800 UIApplicationMain + 664
32 MyApp 0x0000206e main (main.m:14)
33 MyApp 0x00002038 0x1000 + 4152
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x36100fbc kevent + 24
1 libdispatch.dylib 0x33d0b032 _dispatch_mgr_invoke + 706
2 libdispatch.dylib 0x33d0c03a _dispatch_queue_invoke + 86
3 libdispatch.dylib 0x33d0b5ea _dispatch_worker_thread2 + 186
4 libsystem_c.dylib 0x33e0a58a _pthread_wqthread + 258
5 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 2:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 WebCore 0x34c2627e RunWebThread(void*) + 382
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 4 name: com.apple.coremedia.player.async
Thread 4:
0 libsystem_kernel.dylib 0x360ffd18 __semwait_signal + 24
1 libsystem_c.dylib 0x33e30860 _pthread_cond_wait + 756
2 libsystem_c.dylib 0x33dd7eb2 pthread_cond_wait + 26
3 CoreMedia 0x3661d8f4 WaitOnCondition + 4
4 CoreMedia 0x3661d83a FigSemaphoreWaitRelative + 66
5 MediaToolbox 0x324a9a64 fpa_AsyncMovieControlThread + 48
6 CoreMedia 0x3663b4dc figThreadMain + 156
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x3ee4648c r5: 0x00000006 r6: 0x001f1dac r7: 0x2fdfe0d4
r8: 0x0001d6cc r9: 0x00000065 r10: 0x001befb0 r11: 0x00000000
ip: 0x00000148 sp: 0x2fdfe0c8 lr: 0x3489b3bb pc: 0x36b91a1c
cpsr: 0x000f0010
The last one:
Date/Time: 2011-04-28 19:13:44.770 -0700
OS Version: iPhone OS 4.3.2 (8H7)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x624f7473
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x33b2b72a prepareForMethodLookup + 10
1 libobjc.A.dylib 0x33b27876 lookUpMethod + 34
2 libobjc.A.dylib 0x33b24ffa _class_lookupMethodAndLoadCache + 6
3 libobjc.A.dylib 0x33b24ce4 objc_msgSend_uncached + 20
4 UIKit 0x358b5ec2 -[UIApplication sendAction:to:from:forEvent:] + 78
5 UIKit 0x358b5e62 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
6 UIKit 0x358b5e34 -[UIControl sendAction:to:forEvent:] + 32
7 UIKit 0x358b5b86 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350
8 UIKit 0x358b641c -[UIControl touchesEnded:withEvent:] + 336
9 UIKit 0x3589b52e _UIGestureRecognizerSortAndSendDelayedTouches + 2194
10 UIKit 0x3589abfa _UIGestureRecognizerUpdateObserver + 690
11 CoreFoundation 0x3039ca2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10
12 CoreFoundation 0x3039e45e __CFRunLoopDoObservers + 406
13 CoreFoundation 0x3039f754 __CFRunLoopRun + 848
14 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
15 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
16 GraphicsServices 0x35571418 GSEventRunModal + 108
17 GraphicsServices 0x355714c4 GSEventRun + 56
18 UIKit 0x358c7d62 -[UIApplication _run] + 398
19 UIKit 0x358c5800 UIApplicationMain + 664
20 MyApp 0x0000206e main (main.m:14)
21 MyApp 0x00002038 0x1000 + 4152
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x36100fbc kevent + 24
1 libdispatch.dylib 0x33d0b032 _dispatch_mgr_invoke + 706
2 libdispatch.dylib 0x33d0c03a _dispatch_queue_invoke + 86
3 libdispatch.dylib 0x33d0b5ea _dispatch_worker_thread2 + 186
4 libsystem_c.dylib 0x33e0a58a _pthread_wqthread + 258
5 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 WebCore 0x34c2627e RunWebThread(void*) + 382
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 3 name: com.apple.coremedia.player.async
Thread 3:
0 libsystem_kernel.dylib 0x360ffd18 __semwait_signal + 24
1 libsystem_c.dylib 0x33e30860 _pthread_cond_wait + 756
2 libsystem_c.dylib 0x33dd7eb2 pthread_cond_wait + 26
3 CoreMedia 0x3661d8f4 WaitOnCondition + 4
4 CoreMedia 0x3661d83a FigSemaphoreWaitRelative + 66
5 MediaToolbox 0x324a9a64 fpa_AsyncMovieControlThread + 48
6 CoreMedia 0x3663b4dc figThreadMain + 156
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x3662562e r1: 0x3665003c r2: 0x00000001 r3: 0x624f7473
r4: 0x00180af0 r5: 0x3662562e r6: 0x00000001 r7: 0x2fdfe57c
r8: 0x3662562e r9: 0x3edb2a18 r10: 0x0019b7c0 r11: 0x0019b7c0
ip: 0x345b6ff5 sp: 0x2fdfe570 lr: 0x345b987d pc: 0x345bd72a
cpsr: 0x600f0030
Does your app compile without any warnings?
If not, I'd suggest you tackle those first.

Resources