ios 8.1 - controller with UIWebView not shown without WiFi connection - ios

Few days ago i started receiving user reports that my app is not working. After few hours of investigation i've found that controller is not shown ([self.navigationController pushViewController:terminalController animated:YES];) if it has UIWebView and there is no wifi connection! I did not believe it but i have 2 controllers - one with loading 'about the app' page and another is for showing some built-in app documentation. I'm testing on ios 8.1.2 and ipad 2.
Controller's viewDidLoad just is not invoked and the app just freezes. I've checked few times - if i turn wifi on and relaunch the app controllers are shown!
The problem is that i'm using uiwebview for showing local pages and it does not require wifi connection, so most users are very confused.
Any workaround?
Update: here is how i push controller:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"Main" bundle: nil];
ASTerminalController *terminalController = [storyboard instantiateViewControllerWithIdentifier:#"ASTerminalController"];
terminalController.htmlFilename = self.outputFilePath;
[self.navigationController pushViewController:terminalController animated:YES];
Update2: i've modified the app and now i'm creating UIWebView not in storyboard but in code. Now i can see initWithFrame hangs is there is no internet connection:
self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
Update 1: probably some 3rd-party code uses UIWebView and somehow blocks it (see semaphore is used):
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x3aa34540 semaphore_wait_trap + 8
1 libsystem_platform.dylib 0x3aabf431 _os_semaphore_wait + 9
2 libdispatch.dylib 0x01b966f7 0x1b94000 + 9975
3 UIKit 0x2ff893ef +[UIWebDocumentView initialize] + 39
4 libobjc.A.dylib 0x3a4024d5 _class_initialize + 533
5 libobjc.A.dylib 0x3a4022fd _class_initialize + 61
6 libobjc.A.dylib 0x3a40805b lookUpImpOrForward + 251
7 libobjc.A.dylib 0x3a407f53 _class_lookupMethodAndLoadCache3 + 31
8 libobjc.A.dylib 0x3a40e1d7 _objc_msgSend_uncached + 23
9 UIKit 0x2fe743d1 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) containerIsBrowserView] + 73
10 UIKit 0x2fe74353 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) textDocument] + 35
11 UIKit 0x2fe74271 -[UITextSelectionView selection] + 41
12 UIKit 0x2fe74e7f -[UITextSelectionView selectionChanged] + 167
13 UIKit 0x304f17bb __47-[UITextInputController _setSelectedTextRange:]_block_invoke251 + 223
14 UIKit 0x2fe74d8b __52-[UITextInputController _coordinateSelectionChange:]_block_invoke + 83
15 UIFoundation 0x3756bb63 -[NSTextStorage coordinateReading:] + 35
16 UIKit 0x2fe74d31 -[UITextInputController _coordinateSelectionChange:] + 97
17 UIKit 0x304f14d3 -[UITextInputController _setSelectedTextRange:] + 599
18 UIKit 0x2feda6db -[UITextView setAttributedText:] + 391
19 CppCode 0x0011b925 0xd1000 + 305445
20 CppCode 0x0011d0cb 0xd1000 + 311499
21 CppCode 0x00119daf 0xd1000 + 298415
22 CoreFoundation 0x2c931c5f __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 11
23 CoreFoundation 0x2c88d6d1 _CFXNotificationPost + 1781
24 Foundation 0x2d5bf125 -[NSNotificationCenter postNotificationName:object:userInfo:] + 69
25 Foundation 0x2d5ebe33 -[NSUserDefaults(NSUserDefaults) registerDefaults:] + 71
26 WebKitLegacy 0x389df8cd +[WebView initialize] + 301
27 libobjc.A.dylib 0x3a4024d5 _class_initialize + 533
28 libobjc.A.dylib 0x3a40805b lookUpImpOrForward + 251
29 libobjc.A.dylib 0x3a407f53 _class_lookupMethodAndLoadCache3 + 31
30 libobjc.A.dylib 0x3a40e1d7 _objc_msgSend_uncached + 23
31 WebKitLegacy 0x389df6cf WebKitInitialize + 67
32 UIKit 0x3009cf97 ___UIApplicationLoadWebKit_block_invoke + 151
33 libdispatch.dylib 0x01b959c5 0x1b94000 + 6597
34 libdispatch.dylib 0x01b9662d 0x1b94000 + 9773
35 libobjc.A.dylib 0x3a4024d5 _class_initialize + 533
36 libobjc.A.dylib 0x3a40805b lookUpImpOrForward + 251
37 libobjc.A.dylib 0x3a407f53 _class_lookupMethodAndLoadCache3 + 31
38 libobjc.A.dylib 0x3a40e1d7 _objc_msgSend_uncached + 23
39 CppCode 0x0011182d 0xd1000 + 264237
40 UIKit 0x2fe3a52b -[UIViewController loadViewIfRequired] + 599
41 UIKit 0x2fe3a299 -[UIViewController view] + 21
42 UIKit 0x2ffc3585 -[UINavigationController _startCustomTransition:] + 625
43 UIKit 0x2fee34d3 -[UINavigationController _startDeferredTransitionIfNeeded:] + 419
44 UIKit 0x2fee32d9 -[UINavigationController __viewWillLayoutSubviews] + 41
45 UIKit 0x2fee326d -[UILayoutContainerView layoutSubviews] + 181
46 UIKit 0x2fe37a6b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 511
47 QuartzCore 0x2f85fa09 -[CALayer layoutSublayers] + 133
48 QuartzCore 0x2f85b3e1 CA::Layer::layout_if_needed(CA::Transaction*) + 357
49 QuartzCore 0x2f85b269 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 13
50 QuartzCore 0x2f85ac4d CA::Context::commit_transaction(CA::Transaction*) + 221
51 QuartzCore 0x2f85aa51 CA::Transaction::commit() + 321
52 QuartzCore 0x2f854929 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 53
53 CoreFoundation 0x2c93fd93 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 19
54 CoreFoundation 0x2c93d44f __CFRunLoopDoObservers + 275
55 CoreFoundation 0x2c93d857 __CFRunLoopRun + 911
56 CoreFoundation 0x2c88b3bd CFRunLoopRunSpecific + 473
57 CoreFoundation 0x2c88b1cf CFRunLoopRunInMode + 103
58 GraphicsServices 0x33c200a5 GSEventRunModal + 133
59 UIKit 0x2fe997ad UIApplicationMain + 1437
60 CppCode 0x0011f619 0xd1000 + 321049
61 libdyld.dylib 0x3a981aad start + 1

Related

-[_UIFieldEditorLayoutManager addTextContainer:] unrecognized selector sent to instance

Crashlytics reported the following error:
Fatal Exception: NSInvalidArgumentException - [_ UIFieldEditorLayoutManager addTextContainer:] unrecognized selector sent to the instance
...
My question is: How can I control this Exception?
Greetings.
Code:
-(void) method{
NSError *authError = nil;
LAContext *laCtx = [[LAContext alloc] init];
if ([laCtx canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
...
}
} else {
[txtField becomeFirstResponder];
self.navigationItem.hidesBackButton = NO;
}
}
The report shows the crash in the line: self.navigationItem.hidesBackButton = NO;. But I think it has to do with the text field (due to the error message).
The crash report indicates:
0 iosApp 0x4e8221 CLSProcessRecordAllThreads + 4362785
1 iosApp 0x4e8221 CLSProcessRecordAllThreads + 4362785
2 iosApp 0x4e8119 CLSProcessRecordAllThreads + 4362521
3 iosApp 0x4dc05f CLSHandler + 4313183
4 iosApp 0x4e6b0b __CLSExceptionRecord_block_invoke + 4356875
5 libdispatch.dylib 0x23739b47 _dispatch_client_callout + 22
6 libdispatch.dylib 0x23745355 _dispatch_barrier_sync_f_invoke + 56
7 iosApp 0x4e650d CLSExceptionRecord + 4355341
8 iosApp 0x4e6335 CLSExceptionRecordNSException + 4354869
9 iosApp 0x4e5e4b CLSTerminateHandler() + 4353611
10 libc++abi.dylib 0x23358e17 std::__terminate(void (*)()) + 78
11 libc++abi.dylib 0x233585f5 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 110
12 libobjc.A.dylib 0x23366eeb objc_exception_throw + 250
13 CoreFoundation 0x23bc5925 __methodDescriptionForSelector + 186
14 CoreFoundation 0x23bc3559 __forwarding __ + 700
15 CoreFoundation 0x23af3c08 _CF_forwarding_prep_0 + 24
16 UIKit 0x27e0bc59 -[UIFieldEditor initWithFrame:] + 584
17 UIKit 0x27d1c44d +[UIFieldEditor sharedFieldEditor] + 88
18 UIKit 0x27e0b7d5 -[UITextField _becomeFirstResponder] + 184
19 UIKit 0x27d8374d -[UIResponder becomeFirstResponder] + 396
20 UIKit 0x27d83b29 -[UIView(Hierarchy) becomeFirstResponder] + 132
21 UIKit 0x27e0a39d -[UITextField becomeFirstResponder] + 48
22 iosApp 0x22a5bd -[MyViewController methodCrashed] (MyViewController.m:175)
23 iosApp 0x229fdf __45-[MyViewController methodLCS]_block_invoke (MyViewController.m:91)
24 Framework1 0x167a3c9 -[MyViewControllerLCS requestAuthorizationWithHandler:] (MyViewControllerLCS.m:48)
25 iosApp 0x229eb5 -[MyViewController methodLCS] (MyViewController.m:106)
26 iosApp 0x229e25 -[MyViewController viewDidAppear:] (MyViewController.m:73)
27 UIKit 0x27d152af -[UIViewController _setViewAppearState:isAnimating:] + 670
28 UIKit 0x27d15837 -[UIViewController _endAppearanceTransition:] + 258
29 UIKit 0x27dd0fdb -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 986
30 UIKit 0x27eab2d7 __49-[UINavigationController _startCustomTransition:]_block_invoke + 210
31 UIKit 0x27e2909f -[_UIViewControllerTransitionContext completeTransition:] + 90
32 UIKit 0x27f8ddfb __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke95 + 682
33 UIKit 0x27d37b25 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 540
34 UIKit 0x27d37605 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 204
35 UIKit 0x27d374ff -[UIViewAnimationState animationDidStop:finished:] + 78
36 QuartzCore 0x25dfea21 CA::Layer::run_animation_callbacks(void*) + 252
37 libdispatch.dylib 0x23739b47 _dispatch_client_callout + 22
38 libdispatch.dylib 0x23747ee1 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1524
39 CoreFoundation 0x23b833fd _CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE_ + 8
40 CoreFoundation 0x23b818f7 __CFRunLoopRun + 1574
41 CoreFoundation 0x23ad4bf9 CFRunLoopRunSpecific + 520
42 CoreFoundation 0x23ad49e5 CFRunLoopRunInMode + 108
43 GraphicsServices 0x24d20ac9 GSEventRunModal + 160
44 UIKit 0x27d64ba1 UIApplicationMain + 144
45 iosApp 0x342779 main (main.m:14)
46 libdispatch.dylib 0x23783873 (Missing)

IOS iPhone app crash with [NSObject(NSObject) doesNotRecognizeSelector:] and _objc_msgSend_uncached

Here is the crash report not sure why
Incident Identifier: 8F69B0C7-F57D-40C7-B8E7-7A846EDCFE2E
CrashReporter Key: e18182a2b39e52acee70b63eb8a627bf2e6392ec
Hardware Model: iPad2,2
Process: androppo [1105]
Path: /private/var/mobile/Containers/Bundle/Application/EA41AE7C-D8E6-49E3-B124-6FDA7F51A4BD/androppo.app/androppo
Identifier: buzoo.jp.roppow
Version: 1.1 (1.1)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-10-22 12:36:38.195 +0700
Launch Time: 2014-10-22 12:36:37.387 +0700
OS Version: iOS 8.1 (12B410)
Report Version: 105
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Last Exception Backtrace:
0 CoreFoundation 0x25d69d62 __exceptionPreprocess + 122
1 libobjc.A.dylib 0x33949c72 objc_exception_throw + 34
2 CoreFoundation 0x25d6f144 +[NSObject(NSObject) doesNotRecognizeSelector:] + 184
3 CoreFoundation 0x25d6d104 ___forwarding___ + 708
4 CoreFoundation 0x25c9e934 _CF_forwarding_prep_0 + 20
5 androppo 0x000def1c -[GADStatisticDictionary decrementNumberForKey:shouldNotifyDelegate:] + 68
6 androppo 0x000d3f30 -[GADApplication init] + 588
7 androppo 0x000d3cb8 __35+[GADApplication sharedApplication]_block_invoke + 40
8 libdispatch.dylib 0x33eaa40a _dispatch_client_callout + 18
9 libdispatch.dylib 0x33eb79e2 dispatch_once_f$VARIANT$mp + 58
10 androppo 0x000d3c88 +[GADApplication sharedApplication] + 148
11 androppo 0x000cf810 +[GADSlot initialize] + 72
12 libobjc.A.dylib 0x3394a4c0 _class_initialize + 532
13 libobjc.A.dylib 0x33950042 lookUpImpOrForward + 250
14 libobjc.A.dylib 0x3394ff3a _class_lookupMethodAndLoadCache3 + 30
15 libobjc.A.dylib 0x339561f4 _objc_msgSend_uncached + 20
16 androppo 0x000cd760 -[GADBannerView commonInitWithAdSize:] + 56
17 androppo 0x000cd9e0 -[GADBannerView initWithFrame:adSize:] + 164
18 androppo 0x000cdbbc -[GADBannerView initWithAdSize:] + 108
19 androppo 0x0007a9d8 -[MainPageVC addBannerOfAdmob] (MainPageVC.m:810)
20 androppo 0x00075bda -[MainPageVC viewDidLoad] (MainPageVC.m:105)
21 UIKit 0x2920e700 -[UIViewController loadViewIfRequired] + 596
22 UIKit 0x292b85a0 -[UINavigationController _layoutViewController:] + 28
23 UIKit 0x292b84c8 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 224
24 UIKit 0x292b7a4c -[UINavigationController _startTransition:fromViewController:toViewController:] + 60
25 UIKit 0x292b7786 -[UINavigationController _startDeferredTransitionIfNeeded:] + 574
26 UIKit 0x292b74ec -[UINavigationController __viewWillLayoutSubviews] + 40
27 UIKit 0x292b7484 -[UILayoutContainerView layoutSubviews] + 180
28 UIKit 0x2920bc1a -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 510
29 QuartzCore 0x28c36f60 -[CALayer layoutSublayers] + 132
30 QuartzCore 0x28c3294c CA::Layer::layout_if_needed(CA::Transaction*) + 356
31 QuartzCore 0x28c327d4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
32 QuartzCore 0x28c321c2 CA::Context::commit_transaction(CA::Transaction*) + 218
33 QuartzCore 0x28c31fcc CA::Transaction::commit() + 320
34 UIKit 0x2946fa58 -[UIApplication _reportMainSceneUpdateFinished:] + 40
35 UIKit 0x294707f0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2496
36 UIKit 0x2947ac34 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 32
37 UIKit 0x2946ec26 -[UIApplication workspaceDidEndTransaction:] + 126
38 FrontBoardServices 0x2c4920dc __31-[FBSSerialQueue performAsync:]_block_invoke + 8
39 CoreFoundation 0x25d30608 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 8
40 CoreFoundation 0x25d2f8cc __CFRunLoopDoBlocks + 212
41 CoreFoundation 0x25d2e086 __CFRunLoopRun + 782
42 CoreFoundation 0x25c7b97c CFRunLoopRunSpecific + 472
43 CoreFoundation 0x25c7b78e CFRunLoopRunInMode + 102
44 UIKit 0x29272b82 -[UIApplication _run] + 554
45 UIKit 0x2926d97c UIApplicationMain + 1436
46 androppo 0x0007479a main (main.m:16)
47 androppo 0x000746ac start + 36
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x33faadfc __pthread_kill + 8
1 libsystem_pthread.dylib 0x3402ad0e pthread_kill + 58
2 libsystem_c.dylib 0x33f4a934 abort + 72
3 libc++abi.dylib 0x33156bb8 abort_message + 84
4 libc++abi.dylib 0x3317066a default_terminate_handler() + 262
5 libobjc.A.dylib 0x33949f0e _objc_terminate() + 190
6 libc++abi.dylib 0x3316ddec std::__terminate(void (*)()) + 76
7 libc++abi.dylib 0x3316d5ac __cxa_throw + 108
8 libobjc.A.dylib 0x33949d46 objc_exception_throw + 246
9 CoreFoundation 0x25d6f144 +[NSObject(NSObject) doesNotRecognizeSelector:] + 184
10 CoreFoundation 0x25d6d104 ___forwarding___ + 708
11 CoreFoundation 0x25c9e934 _CF_forwarding_prep_0 + 20
12 androppo 0x000def1c -[GADStatisticDictionary decrementNumberForKey:shouldNotifyDelegate:] + 68
13 androppo 0x000d3f30 -[GADApplication init] + 588
14 androppo 0x000d3cb8 __35+[GADApplication sharedApplication]_block_invoke + 40
15 libdispatch.dylib 0x33eaa40c _dispatch_client_callout + 20
16 libdispatch.dylib 0x33eb79e2 dispatch_once_f$VARIANT$mp + 58
17 androppo 0x000d3c88 +[GADApplication sharedApplication] + 148
18 androppo 0x000cf810 +[GADSlot initialize] + 72
19 libobjc.A.dylib 0x3394a4c0 _class_initialize + 532
20 libobjc.A.dylib 0x33950042 lookUpImpOrForward + 250
21 libobjc.A.dylib 0x3394ff3a _class_lookupMethodAndLoadCache3 + 30
22 libobjc.A.dylib 0x339561f6 _objc_msgSend_uncached + 22
23 androppo 0x000cd760 -[GADBannerView commonInitWithAdSize:] + 56
24 androppo 0x000cd9e0 -[GADBannerView initWithFrame:adSize:] + 164
25 androppo 0x000cdbbc -[GADBannerView initWithAdSize:] + 108
26 androppo 0x0007a9d8 -[MainPageVC addBannerOfAdmob] (MainPageVC.m:810)
27 androppo 0x00075bda -[MainPageVC viewDidLoad] (MainPageVC.m:105)
28 UIKit 0x2920e700 -[UIViewController loadViewIfRequired] + 596
29 UIKit 0x292b85a0 -[UINavigationController _layoutViewController:] + 28
30 UIKit 0x292b84c8 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 224
31 UIKit 0x292b7a4c -[UINavigationController _startTransition:fromViewController:toViewController:] + 60
32 UIKit 0x292b7786 -[UINavigationController _startDeferredTransitionIfNeeded:] + 574
33 UIKit 0x292b74ec -[UINavigationController __viewWillLayoutSubviews] + 40
34 UIKit 0x292b7484 -[UILayoutContainerView layoutSubviews] + 180
35 UIKit 0x2920bc1a -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 510
36 QuartzCore 0x28c36f60 -[CALayer layoutSublayers] + 132
37 QuartzCore 0x28c3294c CA::Layer::layout_if_needed(CA::Transaction*) + 356
38 QuartzCore 0x28c327d4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
39 QuartzCore 0x28c321c2 CA::Context::commit_transaction(CA::Transaction*) + 218
40 QuartzCore 0x28c31fcc CA::Transaction::commit() + 320
41 UIKit 0x2946fa58 -[UIApplication _reportMainSceneUpdateFinished:] + 40
42 UIKit 0x294707f0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2496
43 UIKit 0x2947ac34 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 32
44 UIKit 0x2946ec28 -[UIApplication workspaceDidEndTransaction:] + 128
45 FrontBoardServices 0x2c4920de __31-[FBSSerialQueue performAsync:]_block_invoke + 10
46 CoreFoundation 0x25d3060a __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 10
47 CoreFoundation 0x25d2f8cc __CFRunLoopDoBlocks + 212
48 CoreFoundation 0x25d2e086 __CFRunLoopRun + 782
49 CoreFoundation 0x25c7b97c CFRunLoopRunSpecific + 472
50 CoreFoundation 0x25c7b78e CFRunLoopRunInMode + 102
51 UIKit 0x29272b82 -[UIApplication _run] + 554
52 UIKit 0x2926d97c UIApplicationMain + 1436
53 androppo 0x0007479a main (main.m:16)
54 androppo 0x000746ac start + 36
This happened when I tried to run the app's .ipa through profile mode or window->devices, then drag the .ipa file to my device's app list. Yet It didn't happen if it ran in normal mode (cmd + r). I have no idea about the crash log and what caused the crash happened. Could someone help me out, I must fix the issues today and submit to Itunes Connect. I would really appreciate the help. Thanks.

App crashes in Thread 0 (Only on AdHoc)

My app was recently rejected for a crash when loading a tableview. I could only reproduce the crash when running an ad-hoc build. Here's the crash log:
Last Exception Backtrace:
0 CoreFoundation 0x30ecbe7e __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3b2286c2 objc_exception_throw + 34
2 CoreFoundation 0x30ecf7b2 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198
3 CoreFoundation 0x30ece0aa ___forwarding___ + 702
4 CoreFoundation 0x30e1cdc4 __forwarding_prep_0___ + 20
5 HSHacks 0x0011a368 -[FRepo initWithRepoInfo:andPersistence:] (FRepo.m:51)
6 HSHacks 0x00119b58 -[FRepoManager getLocalRepo:] (FRepoManager.m:85)
7 HSHacks 0x0011a1f0 +[FRepoManager getRepo:] (FRepoManager.m:126)
8 HSHacks 0x00132144 -[Firebase initWithUrl:] (Firebase.m:50)
9 HSHacks 0x000d0d8c -[ChatViewController viewDidLoad] (ChatViewController.m:61)
10 UIKit 0x33654956 -[UIViewController loadViewIfRequired] + 514
11 UIKit 0x33654714 -[UIViewController view] + 20
12 UIKit 0x3377bd8a -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 350
13 UIKit 0x3377bc1e -[UITabBarController transitionFromViewController:toViewController:] + 34
14 UIKit 0x3377bb2a -[UITabBarController _setSelectedViewController:] + 254
15 UIKit 0x33846840 -[UITabBarController _tabBarItemClicked:] + 268
16 UIKit 0x33684d9e -[UIApplication sendAction:to:from:forEvent:] + 86
17 UIKit 0x33684d3a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 34
18 UIKit 0x338466f6 -[UITabBar _sendAction:withEvent:] + 366
19 UIKit 0x33684d9e -[UIApplication sendAction:to:from:forEvent:] + 86
20 UIKit 0x33684d3a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 34
21 UIKit 0x33684d0e -[UIControl sendAction:to:forEvent:] + 42
22 UIKit 0x3367073e -[UIControl _sendActionsForEvents:withEvent:] + 370
23 UIKit 0x33684d9e -[UIApplication sendAction:to:from:forEvent:] + 86
24 UIKit 0x33684d3a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 34
25 UIKit 0x33684d0e -[UIControl sendAction:to:forEvent:] + 42
26 UIKit 0x3367073e -[UIControl _sendActionsForEvents:withEvent:] + 370
27 UIKit 0x33684756 -[UIControl touchesEnded:withEvent:] + 590
28 UIKit 0x3364819c _UIGestureRecognizerUpdate + 5524
29 CoreFoundation 0x30e96f64 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
30 CoreFoundation 0x30e948f2 __CFRunLoopDoObservers + 282
31 CoreFoundation 0x30e94c3e __CFRunLoopRun + 734
32 CoreFoundation 0x30dff46c CFRunLoopRunSpecific + 520
33 CoreFoundation 0x30dff24e CFRunLoopRunInMode + 102
34 GraphicsServices 0x35b392e6 GSEventRunModal + 134
35 UIKit 0x336b4840 UIApplicationMain + 1132
36 HSHacks 0x000d7efa main (main.m:16)
37 libdyld.dylib 0x3b721ab2 tlv_initializer + 2
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3b7d81fc __pthread_kill + 8
1 libsystem_pthread.dylib 0x3b83fa4e pthread_kill + 54
2 libsystem_c.dylib 0x3b789028 abort + 72
3 libc++abi.dylib 0x3abd798a abort_message + 70
4 libc++abi.dylib 0x3abf06e2 default_terminate_handler() + 250
5 libobjc.A.dylib 0x3b228936 _objc_terminate() + 190
6 libc++abi.dylib 0x3abee1b0 std::__terminate(void (*)()) + 76
7 libc++abi.dylib 0x3abedd12 __cxa_rethrow + 98
8 libobjc.A.dylib 0x3b22880a objc_exception_rethrow + 38
9 CoreFoundation 0x30dff4e2 CFRunLoopRunSpecific + 638
10 CoreFoundation 0x30dff24e CFRunLoopRunInMode + 102
11 GraphicsServices 0x35b392e6 GSEventRunModal + 134
12 UIKit 0x336b4840 UIApplicationMain + 1132
13 HSHacks 0x000d7efa main (main.m:16)
14 libdyld.dylib 0x3b721ab4 start + 0
Anybody have any idea what's going on?
I think it may have something to do with this code in viewDidLoad:
[self.firebase observeEventType:FEventTypeChildAdded withBlock:^(FDataSnapshot *snapshot) {
// Add the chat message to the array.
[self.chat addObject:snapshot.value];
// Reload the table view so the new message will show up.
[SVProgressHUD dismiss];
[self.chatTableView reloadData];
self.chatTextField.userInteractionEnabled = TRUE;
[self.chatTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:self.chat.count-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:NO];
}];
}

Random crash on setting UITabBarButton label attributed text (Tab Title)

I am not able to reproduce this crash but received this kind of crashes multiple times from production build. In my app tab bar is loaded from storyboard only and tab bar is always hidden all the time.
Does it's main cause is low memory? Any guess, how to solve or reproduce this kind of problems
Hardware Model: iPad2,4
OS Version: iPhone OS 7.0.4 (11B554a)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x393f71fc
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray replaceObjectsInRange:withObject:length:: Out of bounds'
Last Exception Backtrace:
0 CoreFoundation 0x2e766f4b __exceptionPreprocess + 131
1 libobjc.A.dylib 0x38e386af objc_exception_throw + 38
2 CoreFoundation 0x2e766e8d +[NSException raise:format:] + 104
3 Foundation 0x2f089aff -[NSMutableRLEArray replaceObjectsInRange:withObject:length:] + 122
4 Foundation 0x2f088efb -[NSConcreteMutableAttributedString initWithString:attributes:] + 310
5 UIKit 0x30ee8ed7 -[NSAttributedString(UILabelAdditions) _ui_synthesizeAttributedSubstringFromRange:usingDefaultAttributes:] + 86
6 UIKit 0x30ee8c9f -[UILabel _synthesizedAttributedText] + 1010
7 UIKit 0x30ee8307 -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 222
8 UIKit 0x30ee8213 -[UILabel textRectForBounds:limitedToNumberOfLines:] + 54
9 UIKit 0x30ee80fb -[UILabel _intrinsicSizeWithinSize:] + 162
10 UIKit 0x30ee8049 -[UILabel sizeThatFits:] + 32
11 UIKit 0x30ee7f37 -[UIView(Geometry) sizeToFit] + 126
12 UIKit 0x31002be1 -[UITabBarButton initWithImage:selectedImage:label:withInsets:] + 388
13 UIKit 0x31001a1f -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 1170
14 UIKit 0x31001583 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 38
15 UIKit 0x30ffd859 -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 160
16 UIKit 0x31004c43 -[UITabBar(Static) _configureItems:] + 406
17 UIKit 0x310042db -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1234
18 UIKit 0x3100133f -[UITabBar setItems:animated:] + 1358
19 UIKit 0x31000d29 -[UITabBarController _rebuildTabBarItemsAnimated:] + 800
20 UIKit 0x310051f9 -[UITabBarController _setSelectedViewController:] + 76
21 UIKit 0x30eeb6e5 +[UIView(Animation) performWithoutAnimation:] + 72
22 UIKit 0x31008bf7 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 218
23 UIKit 0x31008077 -[UITabBarController viewWillAppear:] + 134
24 UIKit 0x30ef40eb -[UIViewController _setViewAppearState:isAnimating:] + 346
25 CoreFoundation 0x2e6aff65 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 52
26 CoreFoundation 0x2e6a994d -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 220
27 UIKit 0x30ef4265 -[UIViewController _setViewAppearState:isAnimating:] + 724
28 UIKit 0x3106a4bf -[UINavigationController _startCustomTransition:] + 846
29 UIKit 0x30f88273 -[UINavigationController _startDeferredTransitionIfNeeded:] + 418
30 UIKit 0x30f8807d -[UINavigationController __viewWillLayoutSubviews] + 44
31 UIKit 0x30f88015 -[UILayoutContainerView layoutSubviews] + 184
32 UIKit 0x30ed9da3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 346
33 QuartzCore 0x30b60c6b -[CALayer layoutSublayers] + 142
34 QuartzCore 0x30b5c47b CA::Layer::layout_if_needed(CA::Transaction*) + 350
35 QuartzCore 0x30b5c30d CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
36 QuartzCore 0x30b5bd1f CA::Context::commit_transaction(CA::Transaction*) + 230
37 QuartzCore 0x30b5bb2f CA::Transaction::commit() + 314
38 QuartzCore 0x30b5585d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
39 CoreFoundation 0x2e7321cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
40 CoreFoundation 0x2e72fb71 __CFRunLoopDoObservers + 284
41 CoreFoundation 0x2e72feb3 __CFRunLoopRun + 730
42 CoreFoundation 0x2e69ac27 CFRunLoopRunSpecific + 522
43 CoreFoundation 0x2e69aa0b CFRunLoopRunInMode + 106
44 GraphicsServices 0x3336e283 GSEventRunModal + 138
45 UIKit 0x30f3e049 UIApplicationMain + 1136
46 MyApp main (in MyApp) (main.m:16)
47 libdyld.dylib 0x39340ab7 start + 2
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x393f71fc __pthread_kill + 8
1 libsystem_c.dylib 0x393a7ffd abort + 77
2 MyApp uncaught_exception_handler (in MyApp) + 27
3 CoreFoundation 0x2e76724f __handleUncaughtException + 579
4 libobjc.A.dylib 0x38e3890f _objc_terminate() + 175
5 libc++abi.dylib 0x386ed1c7 std::__terminate(void (*)()) + 79
6 libc++abi.dylib 0x386ecd2d __cxa_increment_exception_refcount + 1
7 libobjc.A.dylib 0x38e387f7 objc_exception_rethrow + 43
8 CoreFoundation 0x2e69ac9d CFRunLoopRunSpecific + 641
9 CoreFoundation 0x2e69aa0b CFRunLoopRunInMode + 106
10 GraphicsServices 0x3336e283 GSEventRunModal + 138
11 UIKit 0x30f3e049 UIApplicationMain + 1136
12 MyApp main (in MyApp) (main.m:16)
From you crash log, line 5
5 UIKit 0x30ee8ed7 -[NSAttributedString(UILabelAdditions) _ui_synthesizeAttributedSubstringFromRange:usingDefaultAttributes:] + 86
seems like you generate your attribute string based on
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)aRange
Maybe set a break point at that code, and check if your string length is larger than or equal to the range.

Unable to find root cause of random crash on tabbar

I have a side panel view (like side drawer) in my iPad app which contains tabbar having 2 tabs. This view is beyond the ipad visible screen and become visible once we pull it from left side. This get initialize always on app launch. It crashes randomly on iOS 7.0.3 and 7.0.4 mostly on iPad 4 models. I can't reproduce it in debug mode while debugger is attached and reproducing frequency is 1% or less on release build.
It will not an iOS issue but any guess or anybody faced and solved similar problem?
Crash report:
Hardware Model: iPad3,4
Code Type: ARM (Native)
OS Version: iOS 7.0.4 (11B554a)
Crash report:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 12
Thread 0:
0 libsystem_kernel.dylib 0x38d7ebb4 syscall_thread_switch + 8
1 libsystem_platform.dylib 0x38df349c _os_lock_handoff_lock_slow + 48
2 libsystem_malloc.dylib 0x38db90f8 szone_free_definite_size + 328
3 libRIP.A.dylib 0x2e4ffb72 ripc_ReleaseClipState + 34
4 libRIP.A.dylib 0x2e503438 ripc_EndLayer + 80
5 CoreGraphics 0x2e1c25e8 CGContextEndTransparencyLayer + 36
6 UIKit 0x309e4d2a -[UIImage(TabBarItemImages) _tabBarItemImageWithTintColor:selected:metrics:style:forScreenScale:] + 902
7 UIKit 0x309e5070 -[UIImage(TabBarItemImages) _unselectedTabBarItemImageWithTintColor:metrics:style:forScreenScale:] + 36
8 UIKit 0x309e4748 -[UITabBarItem(Static) _updateImageWithTintColor:isSelected:getImageOffset:] + 552
9 UIKit 0x309e414c -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 956
10 UIKit 0x309e3d82 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 34
11 UIKit 0x309e0028 -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 156
12 UIKit 0x309e74ca -[UITabBar(Static) _configureItems:] + 402
13 UIKit 0x309e6b7e -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1270
14 UIKit 0x309e3b38 -[UITabBar setItems:animated:] + 1352
15 UIKit 0x309e3522 -[UITabBarController _rebuildTabBarItemsAnimated:] + 798
16 UIKit 0x309e7a74 -[UITabBarController _setSelectedViewController:] + 72
17 UIKit 0x308cdcf2 +[UIView(Animation) performWithoutAnimation:] + 70
18 UIKit 0x309eb470 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 216
19 UIKit 0x309ea8e6 -[UITabBarController viewWillAppear:] + 130
20 UIKit 0x308d66fa -[UIViewController _setViewAppearState:isAnimating:] + 342
21 CoreFoundation 0x2e080800 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 48
22 CoreFoundation 0x2e07a21a -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 218
23 UIKit 0x308d6876 -[UIViewController _setViewAppearState:isAnimating:] + 722
24 UIKit 0x30a4ccfa -[UINavigationController _startCustomTransition:] + 842
25 UIKit 0x3096aa12 -[UINavigationController _startDeferredTransitionIfNeeded:] + 414
26 UIKit 0x3096a81c -[UINavigationController __viewWillLayoutSubviews] + 40
27 UIKit 0x3096a7b4 -[UILayoutContainerView layoutSubviews] + 180
28 UIKit 0x308bc34e -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 342
29 QuartzCore 0x3054293e -[CALayer layoutSublayers] + 138
30 QuartzCore 0x3053e162 CA::Layer::layout_if_needed(CA::Transaction*) + 346
31 QuartzCore 0x3053dff4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
32 QuartzCore 0x3053da08 CA::Context::commit_transaction(CA::Transaction*) + 224
33 QuartzCore 0x3053d81a CA::Transaction::commit() + 310
34 QuartzCore 0x30537548 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 52
35 CoreFoundation 0x2e102f66 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
36 CoreFoundation 0x2e1008f2 __CFRunLoopDoObservers + 282
37 CoreFoundation 0x2e100c3e __CFRunLoopRun + 734
38 CoreFoundation 0x2e06b46c CFRunLoopRunSpecific + 520
39 CoreFoundation 0x2e06b24e CFRunLoopRunInMode + 102
40 GraphicsServices 0x32d722e6 GSEventRunModal + 134
41 UIKit 0x30920840 UIApplicationMain + 1132
42 MyApp 0x0006b5f2 0x64000 + 30194
43 libdyld.dylib 0x38cdaab4 start + 0
Thread 12 Crashed:
0 libsystem_kernel.dylib 0x38d911fc __pthread_kill + 8
1 libsystem_pthread.dylib 0x38df8a4e pthread_kill + 54
2 libsystem_c.dylib 0x38d42082 __abort + 74
3 libsystem_c.dylib 0x38d42034 abort + 84
4 libsystem_malloc.dylib 0x38dbf758 szone_error + 312
5 libsystem_malloc.dylib 0x38dbf9d4 free_list_checksum_botch + 24
6 libsystem_malloc.dylib 0x38dba1a4 tiny_free_list_remove_ptr + 76
7 libsystem_malloc.dylib 0x38db9770 szone_free_definite_size + 1984
8 libsystem_blocks.dylib 0x38cf7ac2 _Block_release + 214
9 libdispatch.dylib 0x38ccae76 _dispatch_queue_drain + 370
10 libdispatch.dylib 0x38cc7f8e _dispatch_queue_invoke + 38
11 libdispatch.dylib 0x38ccb742 _dispatch_root_queue_drain + 74
12 libdispatch.dylib 0x38ccb9c0 _dispatch_worker_thread2 + 52
13 libsystem_pthread.dylib 0x38df5dfc _pthread_wqthread + 296
14 libsystem_pthread.dylib 0x38df5cc0 start_wqthread + 4
Another random crash in similar case:
Thread 0 Crashed:
0 CoreFoundation 0x311e9728 -[__NSDictionaryM objectForKey:] + 100
1 UIKit 0x33a3e855 -[UILabel _setFont:] + 209
2 UIKit 0x33b5a411 -[UITabBarButton initWithImage:selectedImage:label:withInsets:] + 293
3 UIKit 0x33b59223 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 1171
4 UIKit 0x33b58d87 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 39
5 UIKit 0x33b5502d -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 161
6 UIKit 0x33b5c4cf -[UITabBar(Static) _configureItems:] + 407
7 UIKit 0x33b5bb83 -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1275
8 UIKit 0x33b58b3d -[UITabBar setItems:animated:] + 1357
9 UIKit 0x33b58527 -[UITabBarController _rebuildTabBarItemsAnimated:] + 803
10 UIKit 0x33b5ca79 -[UITabBarController _setSelectedViewController:] + 77
11 UIKit 0x33a42cf5 +[UIView(Animation) performWithoutAnimation:] + 73
12 UIKit 0x33b60475 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 221
13 UIKit 0x33b5f8eb -[UITabBarController viewWillAppear:] + 135
14 UIKit 0x33a4b6ff -[UIViewController _setViewAppearState:isAnimating:] + 347
15 CoreFoundation 0x311f5803 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 51
16 CoreFoundation 0x311ef21d -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 221
17 UIKit 0x33a4b87b -[UIViewController _setViewAppearState:isAnimating:] + 727
18 UIKit 0x33bc1cff -[UINavigationController _startCustomTransition:] + 847
19 UIKit 0x33adfa17 -[UINavigationController _startDeferredTransitionIfNeeded:] + 419
20 UIKit 0x33adf821 -[UINavigationController __viewWillLayoutSubviews] + 45
21 UIKit 0x33adf7b9 -[UILayoutContainerView layoutSubviews] + 185
22 UIKit 0x33a31353 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 347
23 QuartzCore 0x336b7943 -[CALayer layoutSublayers] + 143
24 QuartzCore 0x336b3167 CA::Layer::layout_if_needed(CA::Transaction*) + 351
25 QuartzCore 0x336b2ff9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 17
26 QuartzCore 0x336b2a0d CA::Context::commit_transaction(CA::Transaction*) + 229
27 QuartzCore 0x336b281f CA::Transaction::commit() + 315
28 QuartzCore 0x336ac54d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 57
29 CoreFoundation 0x31277f69 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
30 CoreFoundation 0x312758f7 __CFRunLoopDoObservers + 287
31 CoreFoundation 0x31275c43 __CFRunLoopRun + 739
32 CoreFoundation 0x311e0471 CFRunLoopRunSpecific + 525
33 CoreFoundation 0x311e0253 CFRunLoopRunInMode + 107
34 GraphicsServices 0x35ee12eb GSEventRunModal + 139
35 UIKit 0x33a95845 UIApplicationMain + 1137
36 SofTestM 0x000545f7 0x4d000 + 30199
The second crash is at time of setting font at
UITabBar-->UITabBarButton->UILabel (of UITabBarButton) _setFont:
I feel this random crashes might be due to memory leaks in your application.Pardon me if i am wrong.
In your logs it is seen that you use CoreGraphics.Releasing Core Graphics( even if you have ARC) is a bit tricky as it is not 100% memory leaf proof .That is it at times takes a while to get released.
So suppose you are using core graphic objects whithin a loop then it is certain that your ipad memory will go out of bounds.

Resources