I have a view which allocates a UILabel and sets the attributed string using NSAttributedString from HTML string. I get the crash during initialising the NSAttributedString. Following is the stack trace of the error:
Thread : Crashed: com.apple.main-thread
0 ??? 0x15e9d6c0
1 QuartzCore 0x2d967993 CA::Display::DisplayLink::get_link(CA::Display::Display*, __CFRunLoop*, X::List<__CFString const*> const*) + 254
2 QuartzCore 0x2d967723 CA::Display::DisplayLinkItem::update_link(__CFRunLoop*) + 162
3 QuartzCore 0x2d98a823 CA::Display::DisplayLinkItem::dispatch() + 170
4 QuartzCore 0x2d98a643 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
5 IOMobileFramebuffer 0x3288dc07 IOMobileFramebufferVsyncNotifyFunc + 90
6 IOKit 0x2b827001 IODispatchCalloutFromCFMessage + 256
7 CoreFoundation 0x2a86324d __CFMachPortPerform + 132
8 CoreFoundation 0x2a8737cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
9 CoreFoundation 0x2a873767 __CFRunLoopDoSource1 + 346
10 CoreFoundation 0x2a871d69 __CFRunLoopRun + 1608
11 CoreFoundation 0x2a7be201 CFRunLoopRunSpecific + 476
12 CoreFoundation 0x2a7be013 CFRunLoopRunInMode + 106
13 UIFoundation 0x3629bb7f -[NSHTMLReader _loadUsingWebKit] + 1950
14 UIFoundation 0x3629ce31 -[NSHTMLReader attributedString] + 24
15 UIFoundation 0x36244445 _NSReadAttributedStringFromURLOrData + 5648
16 UIFoundation 0x36242dad -[NSAttributedString(NSAttributedStringUIFoundationAdditions) initWithData:options:documentAttributes:error:] + 116
17 PageViewScrollView 0x0002ff54 #!objc ext.UIKit.ObjectiveC.NSAttributedString.init (ObjectiveC.NSAttributedString.Type)(data : ObjectiveC.NSData, options : Swift.Optional<Swift.Dictionary<ObjectiveC.NSObject, Swift.AnyObject>>, documentAttributes : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSDictionary>>, error : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSError>>) -> Swift.Optional<ObjectiveC.NSAttributedString> (HTMLTextView.swift)
18 PageViewScrollView 0x00029da4 ext.UIKit.ObjectiveC.NSAttributedString.init (ObjectiveC.NSAttributedString.Type)(data : ObjectiveC.NSData, options : Swift.Optional<Swift.Dictionary<ObjectiveC.NSObject, Swift.AnyObject>>, documentAttributes : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSDictionary>>, error : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSError>>) -> Swift.Optional<ObjectiveC.NSAttributedString> (HTMLTextView.swift)
19 PageViewScrollView 0x00026fd4 PageViewScrollView.HTMLTextView.init (PageViewScrollView.HTMLTextView.Type)(frame : C.CGRect) -> PageViewScrollView.HTMLTextView (HTMLTextView.swift:33)
20 PageViewScrollView 0x000286ac PageViewScrollView.HTMLTextView.__allocating_init (PageViewScrollView.HTMLTextView.Type)(frame : C.CGRect) -> PageViewScrollView.HTMLTextView (HTMLTextView.swift)
21 PageViewScrollView 0x0003fe4c PageViewScrollView.ViewController.getView (PageViewScrollView.ViewController)(Swift.Int) -> Swift.Optional<ObjectiveC.UIView> (ViewController.swift:149)
22 PageViewScrollView 0x0003c7f8 PageViewScrollView.ViewController.scrollViewDidScroll (PageViewScrollView.ViewController)(ObjectiveC.UIScrollView) -> () (ViewController.swift:86)
23 PageViewScrollView 0x0003f5fc #objc PageViewScrollView.ViewController.scrollViewDidScroll (PageViewScrollView.ViewController)(ObjectiveC.UIScrollView) -> () (ViewController.swift)
24 UIKit 0x2e1dc115 -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 64
25 UIKit 0x2df451d5 -[UIScrollView setContentOffset:] + 632
26 UIKit 0x2e0be771 -[UIScrollView _smoothScrollWithUpdateTime:] + 3120
27 QuartzCore 0x2d98a7db CA::Display::DisplayLinkItem::dispatch() + 98
28 QuartzCore 0x2d98a643 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
29 IOMobileFramebuffer 0x3288dc07 IOMobileFramebufferVsyncNotifyFunc + 90
30 IOKit 0x2b827001 IODispatchCalloutFromCFMessage + 256
31 CoreFoundation 0x2a86324d __CFMachPortPerform + 132
32 CoreFoundation 0x2a8737cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
33 CoreFoundation 0x2a873767 __CFRunLoopDoSource1 + 346
34 CoreFoundation 0x2a871d69 __CFRunLoopRun + 1608
35 CoreFoundation 0x2a7be201 CFRunLoopRunSpecific + 476
36 CoreFoundation 0x2a7be013 CFRunLoopRunInMode + 106
37 GraphicsServices 0x3228f201 GSEventRunModal + 136
38 UIKit 0x2df8aa09 UIApplicationMain + 1440
39 PageViewScrollView 0x000448f4 main (AppDelegate.swift:14)
40 libdyld.dylib 0x397a3aaf start + 2
Here is the link to the source code of app where I've used this function. Basically it's a view pager using UIScrollView where views are added and removed as the user so as to keep minimal number of total view in memory. During initialisation of new views containing UILabel with NSAttributedString the above occurs. While scrolling from one view to other new view are created and older are removed from scrollView
I actually found the bug. The problem was that scrollViewDidScroll callbacks are sent on background thread. And I was performing UI updates on background which was causing the problem. Executing the code on main thread using dispatch_async(dispatch_get_main_queue(), block solved the issue.
Related
I received a crash log and am a bit puzzled about it.
0 libobjc.A.dylib 0x000000018e4c20a0 objc_msgSend + 32
1 UIKitCore 0x0000000192be86b8 -[UIView(AdditionalLayoutSupport) _nsis_center:bounds:inEngine:forLayoutGuide:] + 1328 (NSLayoutConstraint_UIKitAdditions.m:3674)
2 UIKitCore 0x0000000192ca003c -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 364 (UIView.m:0)
3 UIKitCore 0x0000000192ca04ac -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 136 (UIView.m:10182)
4 CoreFoundation 0x000000018e77195c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16 (NSArrayHelpers.m:9)
5 CoreFoundation 0x000000018e674fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416 (NSArrayM_Common.h:390)
6 UIKitCore 0x0000000192c9f5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156 (UIView.m:9953)
7 UIKitCore 0x0000000192be76fc -[UIView(AdditionalLayoutSupport) _is_layout] + 148 (NSLayoutConstraint_UIKitAdditions.m:3231)
8 UIKitCore 0x0000000192ca7090 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 1032 (UIView.m:12082)
9 UIKitCore 0x0000000192cba17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140 (UIView.m:17028)
10 QuartzCore 0x00000001952222c0 -[CALayer layoutSublayers] + 284 (CALayer.mm:9627)
11 QuartzCore 0x000000019522843c CA::Layer::layout_if_needed(CA::Transaction*) + 480 (CALayer.mm:9501)
12 QuartzCore 0x0000000195233140 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136 (CALayer.mm:2461)
13 QuartzCore 0x000000019517b884 CA::Context::commit_transaction(CA::Transaction*, double) + 304 (CAContextInternal.mm:1992)
14 QuartzCore 0x00000001951a5574 CA::Transaction::commit() + 676 (CATransactionInternal.mm:438)
15 QuartzCore 0x00000001951a5f68 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92 (CATransactionInternal.mm:888)
16 CoreFoundation 0x000000018e71be68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1758)
17 CoreFoundation 0x000000018e716d54 __CFRunLoopDoObservers + 416 (CFRunLoop.c:1868)
18 CoreFoundation 0x000000018e717320 __CFRunLoopRun + 1308 (CFRunLoop.c:2910)
19 CoreFoundation 0x000000018e716adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192)
20 GraphicsServices 0x00000001986b7328 GSEventRunModal + 104 (GSEvent.c:2246)
21 UIKitCore 0x000000019282463c UIApplicationMain + 1936 (UIApplication.m:4773)
22 MyAppName 0x0000000100b96974 main + 68 (Theme+Fonts.swift:14)
23 libdyld.dylib 0x000000018e5a0360 start + 4
The Theme+Fonts.swift file is a simple enum
enum ThemeFont: String {
case arialBold = "Arial-BoldMT",
arialRoundedBold = "Arial Rounded MT Bold", // This is line 14
…
}
How can I investigate further?
It happened on an iPhone 7. I don't have a device but I tested on the Simulator and got nothing.
This is probably not caused by the enum code but rather has something to do with the callback here
16 CoreFoundation 0x000000018e71be68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1758)
I'm using FMDB in my app. I'm seeing this random crash happening during the app launch.
-(void) addActivities{
[[[DB sharedManager]getSecureQueue] inTransaction:^(FMDatabase * _Nonnull db, BOOL * _Nonnull rollback) {
//process data
}];
}
getSecureQueue returns a FMDatabaseQueue:
_secureQueue= [FMDatabaseQueue databaseQueueWithPath:dbPath];
I checked that _SecureQueue is not nil.
The crash log:
Crashed: fmdb.<FMDatabaseQueue: 0x170242610>
0 libdispatch.dylib 0x18ad83634 _dispatch_barrier_sync_f_slow + 560
1 FMDB 0x101040bd8 -[FMDatabaseQueue beginTransaction:withBlock:] (FMDatabaseQueue.m:228)
2 FMDB 0x101040bd8 -[FMDatabaseQueue beginTransaction:withBlock:] (FMDatabaseQueue.m:228)
3 iPhoneHandheldACT 0x1001e4870 -[HHCTabBarController addActivities] (HHCTabBarController.m:145)
4 iPhoneHandheldACT 0x1001e553c __49-[HHCTabBarController migrateIntoRealm]_block_invoke (HHCTabBarController.m:226)
5 FMDB 0x101040ac4 __30-[FMDatabaseQueue inDatabase:]_block_invoke (FMDatabaseQueue.m:188)
6 libdispatch.dylib 0x18ad729a0 _dispatch_client_callout + 16
7 libdispatch.dylib 0x18ad7fee0 _dispatch_barrier_sync_f_invoke + 84
8 FMDB 0x101040a34 -[FMDatabaseQueue inDatabase:] (FMDatabaseQueue.m:202)
9 iPhoneHandheldACT 0x1001e4ce8 -[HHCTabBarController migrateIntoRealm] (HHCTabBarController.m:181)
10 iPhoneHandheldACT 0x1001e4270 -[HHCTabBarController viewDidLoad] (HHCTabBarController.m:77)
11 UIKit 0x191fecb04 -[UIViewController loadViewIfRequired] + 1036
12 UIKit 0x192004590 -[UIViewController __viewWillAppear:] + 132
13 UIKit 0x192188e18 -[UINavigationController _startCustomTransition:] + 1144
14 UIKit 0x1920a37bc -[UINavigationController _startDeferredTransitionIfNeeded:] + 676
15 UIKit 0x1920a3424 -[UINavigationController __viewWillLayoutSubviews] + 64
16 UIKit 0x1920a3388 -[UILayoutContainerView layoutSubviews] + 188
17 UIKit 0x191fe9cc0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200
18 QuartzCore 0x18f1da274 -[CALayer layoutSublayers] + 148
19 QuartzCore 0x18f1cede8 CA::Layer::layout_if_needed(CA::Transaction*) + 292
20 QuartzCore 0x18f1ceca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
21 QuartzCore 0x18f14a34c CA::Context::commit_transaction(CA::Transaction*) + 252
22 QuartzCore 0x18f1713ac CA::Transaction::commit() + 504
23 QuartzCore 0x18f171e78 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
24 CoreFoundation 0x18be689a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
25 CoreFoundation 0x18be66630 __CFRunLoopDoObservers + 372
26 CoreFoundation 0x18bd96dc4 CFRunLoopRunSpecific + 456
27 UIFoundation 0x191f95134 -[NSHTMLReader _loadUsingWebKit] + 1764
28 Foundation 0x18c9af50c __NSThreadPerformPerform + 340
29 CoreFoundation 0x18be6942c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
30 CoreFoundation 0x18be68d9c __CFRunLoopDoSources0 + 540
31 CoreFoundation 0x18be669a8 __CFRunLoopRun + 744
32 CoreFoundation 0x18bd96da4 CFRunLoopRunSpecific + 424
33 GraphicsServices 0x18d801074 GSEventRunModal + 100
34 UIKit 0x192051c9c UIApplicationMain + 208
35 iPhoneHandheldACT 0x1000a7bf4 main (main.m:16)
36 libdyld.dylib 0x18ada559c start + 4
On line 8, it looks like you're already inside an inDatabase call (i.e. you're already in FMDatabaseQueue when you try to enter the queue again). Don't try to enter serial queue when you're already inside that serial queue. At best, you'll deadlock. If you do that at the wrong time (e.g. during app startup), the watchdog process will kill your app with exception code 0x8badf00d ("ate bad food"; lol; see Technical Note TN2151: Understanding and Analyzing Application Crash Reports).
We receive some reports for crashes in UIWebSelectSinglePicker. We guess it's due to an empty datasource array. This occurs in a webview though. How can we work around this? would prefer a native only solution
edit
happens only on iphones, running both iOS7 and iOS8
1 CoreFoundation __exceptionPreprocess + 127
2 libobjc.A.dylib objc_exception_throw + 36
3 CoreFoundation -[__NSArrayM objectAtIndex:] + 228
4 UIKit -[UIWebSelectSinglePicker pickerView:didSelectRow:inComponent:] + 56
5 UIKit -[UIPickerView _sendSelectionChangedForComponent:notify:] + 90
6 UIKit -[UIPickerTableView _scrollingFinished] + 152
7 UIKit -[UIScrollView(UIScrollViewInternal) _stopScrollDecelerationNotify:] + 842
8 UIKit -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 502
9 UIKit -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:] + 28
10 UIKit -[UIScrollView _smoothScrollWithUpdateTime:] + 208
11 QuartzCore CA::Display::DisplayLinkItem::dispatch() + 96
12 QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 364
13 IOMobileFramebuffer IOMobileFramebufferVsyncNotifyFunc + 88
14 IOKit IODispatchCalloutFromCFMessage + 254
15 CoreFoundation __CFMachPortPerform + 130
16 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
17 CoreFoundation __CFRunLoopDoSource1 + 344
18 CoreFoundation __CFRunLoopRun + 1606
19 CoreFoundation CFRunLoopRunSpecific + 474
20 CoreFoundation CFRunLoopRunInMode + 104
21 GraphicsServices GSEventRunModal + 134
22 UIKit UIApplicationMain + 1438
23 MYAPP main (main.m:16)
24 libdyld.dylib start + 0
I would guess this is related to another issue here on SO
There is an issue with the WebView and system controls triggered from HTML.
I think there is no link with UIWebSelectSinglePicker. I think you are trying to access to an object at an index outside the range of your array.
To prevent this you can add something like:
if(index < [self.myArray count] && [self.myArray count] > 0){
id myobject = [self.myArray objectAtIndex:index];
// do what you want here with your object
}
To debug this kind of issue and find where it happens, try to add a symbolic breakpoint:
Select the breakpoint navigator
click on "+"
"add symbolic breakpoint"
add "objectAtIndex" in the symbol field
I am getting following crash. Can anyone tell me the reason for this crash?
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18 23 CoreFoundation crash
I`m not using threads.
The NSZombieEnabled and instruments did not clarify the reason of the crash at all.
Please, help me.
0 libobjc.A.dylib 0x3b0805be objc_msgSend + 30
1 CoreFoundation 0x3332130c CFRelease + 96
2 CoreFoundation 0x333fc430 __CFBasicHashDrain + 256
3 CoreFoundation 0x333213ce CFRelease + 290
4 CoreFoundation 0x333fc430 __CFBasicHashDrain + 256
5 CoreFoundation 0x333213ce CFRelease + 290
6 ImageIO 0x34013008 _CGImagePlusFinalize + 48
7 CoreFoundation 0x333213ce CFRelease + 290
8 CoreFoundation 0x333fc430 __CFBasicHashDrain + 256
9 CoreFoundation 0x333213ce CFRelease + 290
10 ImageIO 0x34179bb2 releaseInfoPNG + 18
11 ImageIO 0x34029ae4 ImageProviderReleaseInfoCallback + 32
12 CoreGraphics 0x3346b1c8 image_provider_finalize + 32
13 CoreFoundation 0x333213ce CFRelease + 290
14 CoreGraphics 0x33464f48 image_finalize + 60
15 CoreFoundation 0x333213ce CFRelease + 290
16 QuartzCore 0x34fa44ce CA::Layer::State::~State() + 94
17 QuartzCore 0x34fa7a4e CA::Layer::~Layer() + 290
18 QuartzCore 0x34fa77ae -[CALayer dealloc] + 138
19 QuartzCore 0x34f97a70 CA::Layer::free_transaction(CA::Transaction*) + 68
20 QuartzCore 0x34f960a4 CA::Transaction::commit() + 400
21 QuartzCore 0x34f95eac CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
22 CoreFoundation 0x333b56ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
23 CoreFoundation 0x333b39bc __CFRunLoopDoObservers + 272
24 CoreFoundation 0x333b3d12 __CFRunLoopRun + 738
25 CoreFoundation 0x33326eb8 CFRunLoopRunSpecific + 352
26 CoreFoundation 0x33326d44 CFRunLoopRunInMode + 100
27 GraphicsServices 0x36eea2e6 GSEventRunModal + 70
28 UIKit 0x3523c2fc UIApplicationMain + 1116
This crash occurs when using NSNotificationCenter
You registered a notification observer to an object that has been released and didn't removed the observer. So when it tries to call the selector it crashes.
If you are using a ViewController of some kind, you can add
[[NSNotificationCenter defaultCenter] removeObserver:self name:#"Notification" object:nil];
to the viewWillDisappear
if it is not a ViewController you can use -(void) dealloc to unregister the Observer.
I have been trying to figure out what is causing one of the top crashes in my iOS application. It looks like there is some layout happening on a background thread which is causing it to crash. Is there any way to determine what I might be doing that is triggering this relayout? I assume from the stack that it is related to a UIWebView when my app is being brought back into the foreground.
Other stackoverflow threads on the topic seem to mention things like triggering a table reload on a background thread. As far as I can see all the webView delegate methods get called on the main thread. Is there some case where this is not true or are there some other methods which get called on a background thread and I'm just not aware?
Web Thread - Crashed.
0 WebCore _WebTryThreadLock(bool) + 297
1 WebCore _WebTryThreadLock(bool) + 288
2 WebCore WebThreadLock + 66
3 UIKit -[UIWebDocumentView(UIWebDocumentViewTextSelecting) selectionBaseWritingDirection] + 10
4 UIKit -[UITextField _currentTextAlignment] + 86
5 UIKit -[UITextField _showsClearButtonWhenNonEmpty:] + 58
6 UIKit -[UITextField _textRectForBounds:forEditing:] + 678
7 UIKit -[UITextField editingRectForBounds:] + 52
8 UIKit -[UITextField editRect] + 70
9 UIKit -[UITextField layoutSubviews] + 1320
10 UIKit -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 258
11 QuartzCore -[CALayer layoutSublayers] + 214
12 QuartzCore CA::Layer::layout_if_needed(CA::Transaction*) + 460
13 QuartzCore CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
14 QuartzCore CA::Context::commit_transaction(CA::Transaction*) + 238
15 QuartzCore CA::Transaction::commit() + 316
16 QuartzCore CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 60
17 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
18 CoreFoundation __CFRunLoopDoObservers + 276
19 CoreFoundation CFRunLoopRunSpecific + 394
20 CoreFoundation CFRunLoopRunInMode + 104
21 WebCore RunWebThread(void*) + 444
22 libsystem_c.dylib pthread_start + 308
Main - Thread
0 libsystem_kernel.dylib __psynch_mutexwait + 24
1 libsystem_c.dylib pthread_mutex_lock + 392
2 WebCore _WebTryThreadLock(bool) + 336
3 WebCore WebThreadLock + 66
4 WebKit -[WebDatabasePauser applicationWillEnterForeground] + 16
5 CoreFoundation _CFXNotificationPost + 1426
6 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
7 UIKit -[UIApplication _sendWillEnterForegroundCallbacks] + 154
8 UIKit -[UIApplication _handleApplicationResumeEvent:] + 1094
9 UIKit -[UIApplication handleEvent:withNewEvent:] + 1292
10 UIKit -[UIApplication sendEvent:] + 72
11 UIKit _UIApplicationHandleEvent + 6154
12 GraphicsServices _PurpleEventCallback + 590
13 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
14 CoreFoundation __CFRunLoopDoSources0 + 212
15 CoreFoundation __CFRunLoopRun + 646
16 CoreFoundation CFRunLoopRunSpecific + 356
17 CoreFoundation CFRunLoopRunInMode + 104
18 GraphicsServices GSEventRunModal + 74
19 UIKit UIApplicationMain + 1120
20 AppName main.m line 23
It seems you are updating UI on the background thread, in your code add this line wherever you are updating your UI and you are fetching data on the background thread:
dispatch_async(dispatch_get_main_queue(), ^{
// Update data here
});
As soon as you, rather code feels that data is there on device and it's time to update the UI corresponding to new data then try and bring back main thread in action.
Hope it helps.