Animation with CGAffineTransformScale freezes application - ios

I am trying to implement a "disappearing" url bar, when the users scrolls in the webview.
The function below gets called in - (void)scrollViewDidScroll:(UIScrollView *)scrollView.
For specific webpages the app freezes completely and uses 100% CPU. From trial and error we concluded that removing the CGAffineTransformScale fixes this. I am trying to understand why this happens and how else I could implement the same functionality.
- (void)collapseQueryBox
{
_URLBarState = CLQURLBarStateCollapsing;
_queryBoxViewHeightConstraint.constant = COLLAPSED_QUERYBOX_HEIGHT;
[UIView animateWithDuration:COLLAPSE_ANIMATION_DURATION animations:^{
_webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
_queryLabel.transform = CGAffineTransformScale(_queryLabel.transform, COLLAPSE_ANIMATION_SCALE_FACTOR, COLLAPSE_ANIMATION_SCALE_FACTOR);
_queryLabel.layer.backgroundColor = [UIColor clearColor].CGColor;
[_browserContainerView layoutIfNeeded];
} completion:^(BOOL finished) {
_URLBarState = CLQURLBarStateCollapsed;
}];
}
The full stack trace of the paused app in the frozen state:
* thread #1: tid = 0xcbf9f, 0x025b40be libobjc.A.dylib`objc_msgSend + 26, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x025b40be libobjc.A.dylib`objc_msgSend + 26
frame #1: 0x008cf411 Foundation`-[NSISEngine variableToWorkOnAmongVariablesWithIntegralizationViolationsIgnoringLostCauses:varsAlreadyAdjusted:] + 491
frame #2: 0x00a41ea3 Foundation`__44-[NSISEngine fixupIntegralizationViolations]_block_invoke + 1285
frame #3: 0x00a4368c Foundation`-[NSISEngine withBehaviors:performModifications:] + 107
frame #4: 0x008cf21a Foundation`-[NSISEngine withoutOptimizingAtEndRunBlockWithAutomaticOptimizationDisabled:] + 48
frame #5: 0x008cf1d9 Foundation`-[NSISEngine fixupIntegralizationViolations] + 96
frame #6: 0x008ceef8 Foundation`-[NSISEngine optimize] + 204
frame #7: 0x008d57e3 Foundation`-[NSISEngine constraintDidChangeSuchThatMarker:shouldBeReplacedByMarkerPlusDelta:] + 336
frame #8: 0x00a43e23 Foundation`-[NSISEngine tryToChangeConstraintSuchThatMarker:isReplacedByMarkerPlusDelta:undoHandler:] + 489
frame #9: 0x00a4b2d5 Foundation`-[NSLayoutConstraint _tryToChangeContainerGeometryWithUndoHandler:] + 578
frame #10: 0x008c8d4f Foundation`-[NSLayoutConstraint _setSymbolicConstant:constant:] + 384
frame #11: 0x008cb6a1 Foundation`-[NSLayoutConstraint setConstant:] + 52
frame #12: 0x00e398a5 UIKit`-[UIScrollView setContentSize:] + 566
frame #13: 0x01030a5a UIKit`-[UITableViewCell _updateWrapperContentInset] + 117
frame #14: 0x0103963a UIKit`-[UITableViewCell setFrame:] + 701
frame #15: 0x00e1b7b0 UIKit`-[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 840
frame #16: 0x00e1c552 UIKit`-[UIView(Geometry) _resizeWithOldSuperviewSize:] + 290
frame #17: 0x00e1c5aa UIKit`-[UIView(Geometry) resizeWithOldSuperviewSize:] + 80
frame #18: 0x00e1b185 UIKit`__46-[UIView(Geometry) resizeSubviewsWithOldSize:]_block_invoke + 87
frame #19: 0x028a1d86 CoreFoundation`__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 102
frame #20: 0x028a1c5f CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
frame #21: 0x00e1b115 UIKit`-[UIView(Geometry) resizeSubviewsWithOldSize:] + 149
frame #22: 0x00e19c4e UIKit`-[UIView(Geometry) setFrame:] + 559
frame #23: 0x00e1b7b0 UIKit`-[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 840
frame #24: 0x00e1c552 UIKit`-[UIView(Geometry) _resizeWithOldSuperviewSize:] + 290
frame #25: 0x00e1c5aa UIKit`-[UIView(Geometry) resizeWithOldSuperviewSize:] + 80
frame #26: 0x00e1b185 UIKit`__46-[UIView(Geometry) resizeSubviewsWithOldSize:]_block_invoke + 87
frame #27: 0x028a1d86 CoreFoundation`__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 102
frame #28: 0x028a1c5f CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
frame #29: 0x00e1b115 UIKit`-[UIView(Geometry) resizeSubviewsWithOldSize:] + 149
frame #30: 0x00eadc1a UIKit`-[UITableView resizeSubviewsWithOldSize:] + 98
frame #31: 0x00e1c819 UIKit`-[UIView(Geometry) setBounds:] + 510
frame #32: 0x00e39627 UIKit`-[UIScrollView setBounds:] + 1036
frame #33: 0x00eadf5f UIKit`-[UITableView setBounds:] + 260
frame #34: 0x00e1befd UIKit`-[UIView(Geometry) _applyISEngineLayoutValues] + 324
frame #35: 0x00e1c4c0 UIKit`-[UIView(Geometry) _resizeWithOldSuperviewSize:] + 144
frame #36: 0x00e457bb UIKit`-[UIScrollView _resizeWithOldSuperviewSize:] + 73
frame #37: 0x00e1c5aa UIKit`-[UIView(Geometry) resizeWithOldSuperviewSize:] + 80
frame #38: 0x00e1b185 UIKit`__46-[UIView(Geometry) resizeSubviewsWithOldSize:]_block_invoke + 87
frame #39: 0x028a1d86 CoreFoundation`__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 102
frame #40: 0x028a1c5f CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
frame #41: 0x00e1b115 UIKit`-[UIView(Geometry) resizeSubviewsWithOldSize:] + 149
frame #42: 0x0145961c UIKit`-[UIView(AdditionalLayoutSupport) _is_layout] + 158
frame #43: 0x00e20336 UIKit`-[UIView(Hierarchy) layoutSubviews] + 80
frame #44: 0x00e2d964 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
frame #45: 0x025b682b libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
frame #46: 0x01df345a QuartzCore`-[CALayer layoutSublayers] + 148
frame #47: 0x01de7244 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 380
frame #48: 0x01de70b0 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 26
frame #49: 0x01d4d7fa QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 294
frame #50: 0x01d4eb85 QuartzCore`CA::Transaction::commit() + 393
frame #51: 0x01d4f258 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #52: 0x027ed36e CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
frame #53: 0x027ed2bf CoreFoundation`__CFRunLoopDoObservers + 399
frame #54: 0x027cb254 CoreFoundation`__CFRunLoopRun + 1076
frame #55: 0x027ca9d3 CoreFoundation`CFRunLoopRunSpecific + 467
frame #56: 0x027ca7eb CoreFoundation`CFRunLoopRunInMode + 123
frame #57: 0x041895ee GraphicsServices`GSEventRunModal + 192
frame #58: 0x0418942b GraphicsServices`GSEventRun + 104
frame #59: 0x00dbef9b UIKit`UIApplicationMain + 1225

Related

main thread was blocked when i use UIWebView

Today i find a bug in my app relate to UIWebView, there are two case for it, the url i request is https://estore-cn.pandora.net/Bracelets-1/
When I use UIWebView to show a web page, and I exit that page, the webView's dealloc been called, but the UI thread been blocked, and several minutes later it recovers.
This is the thread stack here when I press pause program execution button in Xcode.
* thread #1: tid = 0x580710, 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8
frame #1: 0x0000000180e7239c libsystem_pthread.dylib`_pthread_mutex_lock_wait + 96
frame #2: 0x0000000180e7257c libsystem_pthread.dylib`_pthread_mutex_lock_slow + 296
frame #3: 0x00000001850dc3b0 WebCore`_WebTryThreadLock(bool) + 52
frame #4: 0x00000001850dcb3c WebCore`WebThreadLock + 108
frame #5: 0x00000001865abfc0 UIKit`-[UIWebView dealloc] + 36
frame #6: 0x000000010032ba64 QDaily`-[QDWebView dealloc](self=0x00000001575f3980, _cmd="dealloc") + 148 at QDWebView.m:63
frame #7: 0x0000000180889ae8 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 508
frame #8: 0x00000001810e89fc CoreFoundation`_CFAutoreleasePoolPop + 28
frame #9: 0x00000001811bebc0 CoreFoundation`__CFRunLoopRun + 1636
frame #10: 0x00000001810e8c50 CoreFoundation`CFRunLoopRunSpecific + 384
frame #11: 0x00000001829d0088 GraphicsServices`GSEventRunModal + 180
frame #12: 0x00000001863d6088 UIKit`UIApplicationMain + 204
frame #13: 0x000000010037490c QDaily`main(argc=1, argv=0x000000016fd03af0) + 172 at main.m:16
frame #14: 0x0000000180c868b8 libdyld.dylib`start + 4
second case is ,when i begin skip into the webView page, the same case happened.
thread #1: tid = 0x5801dc, 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8
frame #1: 0x0000000180e7239c libsystem_pthread.dylib`_pthread_mutex_lock_wait + 96
frame #2: 0x0000000180e7257c libsystem_pthread.dylib`_pthread_mutex_lock_slow + 296
frame #3: 0x00000001850dc3b0 WebCore`_WebTryThreadLock(bool) + 52
frame #4: 0x00000001850dcb3c WebCore`WebThreadLock + 108
frame #5: 0x00000001867f3dc4 UIKit`-[UIWebView _webViewCommonInitWithWebView:scalesPageToFit:] + 128
frame #6: 0x00000001865a83ec UIKit`-[UIWebView initWithFrame:] + 80
frame #7: 0x00000001002abb60 QDaily`-[QDWebView initWithFrame:](self=0x0000000000000000, _cmd="initWithFrame:", frame=(origin = (x = 0, y = 20), size = (width = 414, height = 666))) + 120 at QDWebView.m:71
frame #8: 0x0000000100212244 QDaily`-[QDSimpleWebViewController viewDidLoad](self=0x0000000131225070, _cmd="viewDidLoad") + 796 at QDSimpleWebViewController.m:57
frame #9: 0x000000018636cc40 UIKit`-[UIViewController loadViewIfRequired] + 996
frame #10: 0x00000001863850d0 UIKit`-[UIViewController __viewWillAppear:] + 132
frame #11: 0x000000018651fe5c UIKit`-[UINavigationController _startCustomTransition:] + 1052
frame #12: 0x000000018642be40 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 688
frame #13: 0x000000018642bb1c UIKit`-[UINavigationController __viewWillLayoutSubviews] + 60
frame #14: 0x000000018642ba84 UIKit`-[UILayoutContainerView layoutSubviews] + 208
frame #15: 0x00000001863681e4 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 656
frame #16: 0x0000000183cf698c QuartzCore`-[CALayer layoutSublayers] + 148
frame #17: 0x0000000183cf15c8 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 292
frame #18: 0x0000000183cf1488 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
frame #19: 0x0000000183cf0ab8 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 252
frame #20: 0x0000000183cf0818 QuartzCore`CA::Transaction::commit() + 500
frame #21: 0x000000018636aff4 UIKit`_UIApplicationHandleEventQueue + 4980
frame #22: 0x00000001811c109c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #23: 0x00000001811c0b30 CoreFoundation`__CFRunLoopDoSources0 + 540
frame #24: 0x00000001811be830 CoreFoundation`__CFRunLoopRun + 724
frame #25: 0x00000001810e8c50 CoreFoundation`CFRunLoopRunSpecific + 384
frame #26: 0x00000001829d0088 GraphicsServices`GSEventRunModal + 180
frame #27: 0x00000001863d6088 UIKit`UIApplicationMain + 204
frame #28: 0x00000001002f490c QDaily`main(argc=1, argv=0x000000016fd83af0) + 172 at main.m:16
frame #29: 0x0000000180c868b8 libdyld.dylib`start + 4
I don't know how to resolve it
ADD: this is the webThread when happened dead lock
* thread #19: tid = 0x58076c, 0x00000001854180f0 WebCore`WTF::HashMap<unsigned long, WTF::RefPtr<WebCore::ResourceLoader>, WTF::IntHash<unsigned long>, WTF::HashTraits<unsigned long>, WTF::HashTraits<WTF::RefPtr<WebCore::ResourceLoader> > >::remove(unsigned long const&) + 164, name = 'WebThread'
* frame #0: 0x00000001854180f0 WebCore`WTF::HashMap<unsigned long, WTF::RefPtr<WebCore::ResourceLoader>, WTF::IntHash<unsigned long>, WTF::HashTraits<unsigned long>, WTF::HashTraits<WTF::RefPtr<WebCore::ResourceLoader> > >::remove(unsigned long const&) + 164
frame #1: 0x0000000185126e54 WebCore`WebCore::DocumentLoader::removeSubresourceLoader(WebCore::ResourceLoader*) + 40
frame #2: 0x00000001851292a0 WebCore`WebCore::ResourceLoader::cancel(WebCore::ResourceError const&) + 492
frame #3: 0x0000000185087764 WebCore`WebCore::ResourceLoader::init(WebCore::ResourceRequest const&) + 404
frame #4: 0x00000001850873fc WebCore`WebCore::SubresourceLoader::startLoading() + 36
frame #5: 0x000000018508735c WebCore`WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadScheduler::HostInformation*, WebCore::ResourceLoadPriority) + 516
frame #6: 0x00000001851070b8 WebCore`WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadPriority) + 412
frame #7: 0x0000000185079f1c WebCore`WebCore::ThreadTimers::sharedTimerFiredInternal() + 148
frame #8: 0x0000000185079e5c WebCore`WebCore::timerFired(__CFRunLoopTimer*, void*) + 36
frame #9: 0x00000001811c1794 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
frame #10: 0x00000001811c1438 CoreFoundation`__CFRunLoopDoTimer + 884
frame #11: 0x00000001811beb4c CoreFoundation`__CFRunLoopRun + 1520
frame #12: 0x00000001810e8c50 CoreFoundation`CFRunLoopRunSpecific + 384
frame #13: 0x00000001850da108 WebCore`RunWebThread(void*) + 456
frame #14: 0x0000000180e6fb28 libsystem_pthread.dylib`_pthread_body + 156
frame #15: 0x0000000180e6fa8c libsystem_pthread.dylib`_pthread_start + 156
frame #16: 0x0000000180e6d028 libsystem_pthread.dylib`thread_start + 4
ADD: JavaScriptCore :: Marking thread
* thread #20: tid = 0x58076d, 0x0000000180da3f24 libsystem_kernel.dylib`__psynch_cvwait + 8, name = 'JavaScriptCore::Marking'
* frame #0: 0x0000000180da3f24 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x0000000180e6ece8 libsystem_pthread.dylib`_pthread_cond_wait + 648
frame #2: 0x00000001807fb42c libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56
frame #3: 0x0000000184bc0d5c JavaScriptCore`JSC::GCThread::waitForNextPhase() + 144
frame #4: 0x0000000184bc0df4 JavaScriptCore`JSC::GCThread::gcThreadMain() + 84
frame #5: 0x0000000184896614 JavaScriptCore`WTF::threadEntryPoint(void*) + 212
frame #6: 0x0000000184896524 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 24
frame #7: 0x0000000180e6fb28 libsystem_pthread.dylib`_pthread_body + 156
frame #8: 0x0000000180e6fa8c libsystem_pthread.dylib`_pthread_start + 156
frame #9: 0x0000000180e6d028 libsystem_pthread.dylib`thread_start + 4

UIWebView Crashing on Drop Down

We are loading HTML with Select control (Drop Down) in UIWebView and when we click on Drop down, the app is crashing. This is happening only when text having lengthy text, but works fine with short Text.
When we debugged, we found its an issue with UILabel in UIPopoverController coming from UIWebView. When UILabel has text with 2 lines, this issue is happening, single line its fine. We are unable to identify the issue whether its with Storyboard or Settings...etc.
Any help will be much appreciated.
Here is the Crash
* thread #1: tid = 0x1bd3, 0x034ad930 CoreFoundation`CFArrayGetValueAtIndex + 112, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x034ad930 CoreFoundation`CFArrayGetValueAtIndex + 112
frame #1: 0x007d1b41 CoreText`TCharStream::CopyBreakIterator(__CFString const*) + 261
frame #2: 0x007d18f4 CoreText`TCharStream::FindLineBreak(CFRange, bool, __CFString const*) const + 246
frame #3: 0x00758a4a CoreText`TTypesetter::SuggestLineBreak(TLine const&, long, double, double) + 328
frame #4: 0x007586b9 CoreText`CTLineSuggestLineBreakWithOffset + 55
frame #5: 0x0839d89f UIFoundation`__NSStringDrawingEngine + 20275
frame #6: 0x08398940 UIFoundation`-[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:] + 201
frame #7: 0x01b265c1 UIKit`-[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 1425
frame #8: 0x01b25e7e UIKit`-[UILabel textRectForBounds:limitedToNumberOfLines:] + 85
frame #9: 0x01d1d0cb UIKit`-[UITableViewCellLayoutManager intrinsicContentSizeForCell:] + 554
frame #10: 0x01c16594 UIKit`-[UITableViewCell sizeThatFits:] + 46
frame #11: 0x02092ade UIKit`-[UIView(UIConstraintBasedLayout) systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 130
frame #12: 0x01c01c9f UIKit`-[UITableViewCell systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 220
frame #13: 0x01a3f847 UIKit`-[UITableView _heightForCell:atIndexPath:] + 386
frame #14: 0x01a302fb UIKit`__53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 2244
frame #15: 0x019987af UIKit`+[UIView(Animation) performWithoutAnimation:] + 82
frame #16: 0x019987f8 UIKit`+[UIView(Animation) _performWithoutAnimation:] + 40
frame #17: 0x01a2fa2f UIKit`-[UITableView _configureCellForDisplay:forIndexPath:] + 355
frame #18: 0x01a381da UIKit`-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 503
frame #19: 0x01a3829e UIKit`-[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 77
frame #20: 0x01a11a6b UIKit`-[UITableView _updateVisibleCellsNow:isRecursive:] + 3034
frame #21: 0x01a2c3d1 UIKit`-[UITableView layoutSubviews] + 222
frame #22: 0x019a1dd1 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
frame #23: 0x02f55771 libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
frame #24: 0x0061f28f QuartzCore`-[CALayer layoutSublayers] + 152
frame #25: 0x00613115 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 397
frame #26: 0x00612f70 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 26
frame #27: 0x005713c6 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 284
frame #28: 0x0057278c QuartzCore`CA::Transaction::commit() + 392
frame #29: 0x00572e58 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #30: 0x034fa9de CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
frame #31: 0x034fa920 CoreFoundation`__CFRunLoopDoObservers + 400
frame #32: 0x034f035a CoreFoundation`__CFRunLoopRun + 1226
frame #33: 0x034efbcb CoreFoundation`CFRunLoopRunSpecific + 443
frame #34: 0x034ef9fb CoreFoundation`CFRunLoopRunInMode + 123
frame #35: 0x04d4224f GraphicsServices`GSEventRunModal + 192
frame #36: 0x04d4208c GraphicsServices`GSEventRun + 104
frame #37: 0x019168b6 UIKit`UIApplicationMain + 1526
* frame #38: 0x000f85bd main(argc=1, argv=0xbff5e584) + 141 at main.m:16
frame #39: 0x04400ac9 libdyld.dylibstart + 1
Thanks,
Vijay
This is a duplicate, see my answer here: https://stackoverflow.com/a/26692948/4206060
In short, put this into your web view delegate:
-(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_USEC), dispatch_get_main_queue(),
^{
[super presentViewController:viewControllerToPresent animated:flag completion:completion];
});
}
This is solved. The issue was because of hardcoding "AppleLanguages" NSDefaults Key to a String. When UIWebview tries to show UILabel it tries to fetch AppleLanguages as Array and crashing.

(lldb) Run time Error on Xcode Version 6.1

When I try to run my Xcode project on my device (iPhone), Xcode is creating a runtime error. Project works fine in iOS Simulator.
I have:
Xcode Version 6.1 (6A1052d)
iOS Simulator Version 8.1 (550.3)
iPhone 5 with iOS 8.1
Project lang: Swift
backtrace info:
(lldb) bt
* thread #1: tid = 0x4e2ca, 0x1fed108c dyld`dyld_fatal_error, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xe7ffdefe)
* frame #0: 0x1fed108c dyld`dyld_fatal_error
frame #1: 0x1fed3902 dyld`dyld::halt(char const*) + 74
frame #2: 0x1fed3b1a dyld`dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 278
frame #3: 0x303dc094 libdyld.dylib`dyld_stub_binder + 20
frame #4: 0x000f7df4 GCFSoccer`GCFSoccer.FavoritesTableViewController.init (aDecoder=0x18085000, self=0x17e31110)(coder : ObjectiveC.NSCoder) -> GCFSoccer.FavoritesTableViewController + 104 at FavoritesTableViewController.swift:19
frame #5: 0x000f80e4 GCFSoccer`#objc GCFSoccer.FavoritesTableViewController.init (GCFSoccer.FavoritesTableViewController.Type)(coder : ObjectiveC.NSCoder) -> GCFSoccer.FavoritesTableViewController + 68 at FavoritesTableViewController.swift:0
frame #6: 0x25f2ef20 UIKit`-[UIClassSwapper initWithCoder:] + 192
frame #7: 0x25ff5d9e UIKit`UINibDecoderDecodeObjectForValue + 850
frame #8: 0x25ff5cf4 UIKit`UINibDecoderDecodeObjectForValue + 680
frame #9: 0x25ff5a3e UIKit`-[UINibDecoder decodeObjectForKey:] + 334
frame #10: 0x25e4bdf8 UIKit`-[UIViewController initWithCoder:] + 1016
frame #11: 0x25e5eeea UIKit`-[UINavigationController initWithCoder:] + 46
frame #12: 0x25ff5d9e UIKit`UINibDecoderDecodeObjectForValue + 850
frame #13: 0x25ff5cf4 UIKit`UINibDecoderDecodeObjectForValue + 680
frame #14: 0x25ff5a3e UIKit`-[UINibDecoder decodeObjectForKey:] + 334
frame #15: 0x25e4bdf8 UIKit`-[UIViewController initWithCoder:] + 1016
frame #16: 0x25e69f02 UIKit`-[UITabBarController initWithCoder:] + 46
frame #17: 0x000c7648 GCFSoccer`GCFSoccer.MainTabBarController.init (aDecoder=0x18085000, self=0x17d4b120)(coder : ObjectiveC.NSCoder) -> GCFSoccer.MainTabBarController + 160 at MainTabBarController.swift:0
frame #18: 0x000c7724 GCFSoccer`#objc GCFSoccer.MainTabBarController.init (GCFSoccer.MainTabBarController.Type)(coder : ObjectiveC.NSCoder) -> GCFSoccer.MainTabBarController + 68 at MainTabBarController.swift:0
frame #19: 0x25f2ef20 UIKit`-[UIClassSwapper initWithCoder:] + 192
frame #20: 0x25ff5d9e UIKit`UINibDecoderDecodeObjectForValue + 850
frame #21: 0x25ff5a3e UIKit`-[UINibDecoder decodeObjectForKey:] + 334
frame #22: 0x25f2eb62 UIKit`-[UIRuntimeConnection initWithCoder:] + 150
frame #23: 0x25ff5d9e UIKit`UINibDecoderDecodeObjectForValue + 850
frame #24: 0x25ff5cf4 UIKit`UINibDecoderDecodeObjectForValue + 680
frame #25: 0x25ff5a3e UIKit`-[UINibDecoder decodeObjectForKey:] + 334
frame #26: 0x25f2e24e UIKit`-[UINib instantiateWithOwner:options:] + 958
frame #27: 0x260c3e9c UIKit`-[UIStoryboard instantiateViewControllerWithIdentifier:] + 196
frame #28: 0x25dd36d4 UIKit`-[UIApplication _loadMainStoryboardFileNamed:bundle:] + 64
frame #29: 0x25dd29f8 UIKit`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1116
frame #30: 0x25ddd378 UIKit`__84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 36
frame #31: 0x25dd1386 UIKit`-[UIApplication workspaceDidEndTransaction:] + 130
frame #32: 0x28e3e0e8 FrontBoardServices`__31-[FBSSerialQueue performAsync:]_block_invoke + 12
frame #33: 0x2267839c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
frame #34: 0x22677660 CoreFoundation`__CFRunLoopDoBlocks + 216
frame #35: 0x22675de2 CoreFoundation`__CFRunLoopRun + 762
frame #36: 0x225c4210 CoreFoundation`CFRunLoopRunSpecific + 476
frame #37: 0x225c4022 CoreFoundation`CFRunLoopRunInMode + 106
frame #38: 0x25bd53ee UIKit`-[UIApplication _run] + 558
frame #39: 0x25bd01d0 UIKit`UIApplicationMain + 1440
frame #40: 0x0010c824 GCFSoccer`top_level_code + 72 at AppDelegate.swift:12
frame #41: 0x0010c860 GCFSoccer`main + 48 at AppDelegate.swift:0
(lldb)
Thank you for your help in advance!

understanding 'lldb' backtace - app crashes when button is pressed

When I click on any button my app crashes. It throws a lldb run time error. I printed the backtrace:
* thread #1: tid = 0x2aaf3, 0x000000018db701c0 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 2.1
frame #0: 0x000000018db701c0 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000181666bd4 CoreFoundation`-[NSException raise] + 12
frame #2: 0x0000000182124720 Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:] + 256
frame #3: 0x00000001815b25ec CoreFoundation`-[NSArray makeObjectsPerformSelector:] + 248
frame #4: 0x00000001849eadd0 UIKit`-[UINib instantiateWithOwner:options:] + 1232
frame #5: 0x000000018492f878 UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 280
frame #6: 0x0000000184630488 UIKit`-[UIViewController loadViewIfRequired] + 88
frame #7: 0x00000001846303f4 UIKit`-[UIViewController view] + 32
frame #8: 0x00000001847dd868 UIKit`-[UINavigationController _startCustomTransition:] + 704
frame #9: 0x00000001846e7f54 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 464
frame #10: 0x00000001846e7d24 UIKit`-[UINavigationController __viewWillLayoutSubviews] + 56
frame #11: 0x00000001846e7ca4 UIKit`-[UILayoutContainerView layoutSubviews] + 200
frame #12: 0x000000018462aff8 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 348
frame #13: 0x000000018421c258 QuartzCore`-[CALayer layoutSublayers] + 184
frame #14: 0x0000000184216e20 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 300
frame #15: 0x0000000184216cd8 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
frame #16: 0x0000000184216560 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 280
frame #17: 0x0000000184216304 QuartzCore`CA::Transaction::commit() + 424
frame #18: 0x000000018420fc38 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
frame #19: 0x00000001816276a8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
frame #20: 0x0000000181624930 CoreFoundation`__CFRunLoopDoObservers + 372
frame #21: 0x0000000181624cbc CoreFoundation`__CFRunLoopRun + 764
frame #22: 0x0000000181565c20 CoreFoundation`CFRunLoopRunSpecific + 452
frame #23: 0x000000018724dc0c GraphicsServices`GSEventRunModal + 168
frame #24: 0x0000000184696fdc UIKit`UIApplicationMain + 1156
* frame #25: 0x00000001001297a4 myapp`main(argc=1, argv=0x000000016fd33ca8) + 116 at main.m:16
frame #26: 0x000000018e163aa0 libdyld.dylib`start + 4
What does it mean?
This is your problem:
Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:]
because after this, is raised an Exception:
CoreFoundation`-[NSException raise] + 12
You are trying to set a value for a key in your object that could not exists or has some other problem.
P.S.: Update your answer with some relevant code so I can update my answer with more explanations.

Getting weird crash on changing device orientation twice

I am navigationcontroller view ,with toolbar,search bar & tableview.
On device orienatation change twice i see weird
*** -[UIImage isKindOfClass:]: message sent to deallocated instance 0x7a31c00
(lldb) bt
* thread #1: tid = 0x1f03, 0x93e06332 libsystem_kernel.dylib`__kill + 10, stop reason = signal SIGKILL
frame #0: 0x93e06332 libsystem_kernel.dylib`__kill + 10
frame #1: 0x93e05932 libsystem_kernel.dylib`kill$UNIX2003 + 32
frame #2: 0x01e10e03 CoreFoundation`___forwarding___ + 227
frame #3: 0x01e10cb2 CoreFoundation`_CF_forwarding_prep_0 + 50
frame #4: 0x00ae1a06 UIKit`-[UIImageView _setViewGeometry:forMetric:] + 295
frame #5: 0x00ae1c2d UIKit`-[UIImageView setFrame:] + 63
frame #6: 0x00a2b9f2 UIKit`-[UIView(Geometry) _resizeWithOldSuperviewSize:] + 838
frame #7: 0x00a2c08a UIKit`-[UIView(Geometry) resizeWithOldSuperviewSize:] + 72
frame #8: 0x00a2b3b5 UIKit`__46-[UIView(Geometry) resizeSubviewsWithOldSize:]_block_invoke_0 + 73
frame #9: 0x01e41f1a CoreFoundation`__NSArrayChunkIterate + 362
frame #10: 0x01e0d635 CoreFoundation`__NSArrayEnumerate + 997
frame #11: 0x01e0d026 CoreFoundation`-[NSArray enumerateObjectsWithOptions:usingBlock:] + 102
frame #12: 0x00a2b353 UIKit`-[UIView(Geometry) resizeSubviewsWithOldSize:] + 149
frame #13: 0x00a2a058 UIKit`-[UIView(Geometry) setFrame:] + 358
frame #14: 0x00abaf20 UIKit`-[UIViewControllerWrapperView setFrame:] + 193
frame #15: 0x00acfc13 UIKit`-[UINavigationController _layoutViewController:] + 335
frame #16: 0x00acf81c UIKit`-[UINavigationController _layoutTopViewController] + 155
frame #17: 0x00ad0899 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded] + 346
frame #18: 0x00ad09e1 UIKit`-[UINavigationController __viewWillLayoutSubviews] + 33
frame #19: 0x00bee5c2 UIKit`-[UILayoutContainerView layoutSubviews] + 222
frame #20: 0x00a34d21 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 145
frame #21: 0x01eabe42 CoreFoundation`-[NSObject performSelector:withObject:] + 66
frame #22: 0x0304e679 QuartzCore`-[CALayer layoutSublayers] + 266
frame #23: 0x03058579 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 231
frame #24: 0x0304e740 QuartzCore`-[CALayer layoutIfNeeded] + 184
frame #25: 0x00a2e938 UIKit`-[UIView(Hierarchy) layoutIfNeeded] + 42
frame #26: 0x00ac898a UIKit`-[UIViewController window:willAnimateRotationToInterfaceOrientation:duration:] + 565
frame #27: 0x00a21ef9 UIKit`-[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 4712
frame #28: 0x00a20c8c UIKit`-[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
frame #29: 0x00a20b97 UIKit`-[UIWindow _setRotatableViewOrientation:duration:force:] + 93
frame #30: 0x00a2017b UIKit`-[UIWindow _updateToInterfaceOrientation:duration:force:] + 228
frame #31: 0x00a202ac UIKit`-[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 162
frame #32: 0x00a20203 UIKit`-[UIWindow _updateInterfaceOrientationFromDeviceOrientationIfRotationEnabled:] + 82
frame #33: 0x00a20028 UIKit`-[UIWindow _handleDeviceOrientationChange:] + 121
frame #34: 0x013b8a29 Foundation`__57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 40
frame #35: 0x01e75855 CoreFoundation`___CFXNotificationPost_block_invoke_0 + 85
frame #36: 0x01e75778 CoreFoundation`_CFXNotificationPost + 1976
frame #37: 0x012fd19a Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 98
frame #38: 0x00bccdb1 UIKit`-[UIDevice setOrientation:animated:] + 220
frame #39: 0x00a042fd UIKit`-[UIApplication handleEvent:withNewEvent:] + 1405
frame #40: 0x00a04c38 UIKit`-[UIApplication sendEvent:] + 68
frame #41: 0x009f8634 UIKit`_UIApplicationHandleEvent + 8196
frame #42: 0x01cadef5 GraphicsServices`PurpleEventCallback + 1274
frame #43: 0x01e7e195 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #44: 0x01de2ff2 CoreFoundation`__CFRunLoopDoSource1 + 146
frame #45: 0x01de18da CoreFoundation`__CFRunLoopRun + 2218
frame #46: 0x01de0d84 CoreFoundation`CFRunLoopRunSpecific + 212
frame #47: 0x01de0c9b CoreFoundation`CFRunLoopRunInMode + 123
frame #48: 0x01cac7d8 GraphicsServices`GSEventRunModal + 190
frame #49: 0x01cac88a GraphicsServices`GSEventRun + 103
frame #50: 0x009f6626 UIKit`UIApplicationMain + 1163
I dont have any code inside delegate
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
shouldAutorotateToInterfaceOrientation supports all orientation
I could find cause of crash
I overide UItoolbar class to create custom toolbar with image in background.which cause crash on orientation change
#interface CustomWhiteToolbar : UIToolbar {
}
#end
#implementation CustomWhiteToolbar
- (void)drawRect:(CGRect)rect {
[super drawRect:rect];
UIImage *img = [UIImage imageNamed: #"White_bordered_background.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
[img release];
self.tintColor = [UIColor clearColor];
}
#end
this cause crash on orientation changes.I have custom toolbar class set to toolbar inside my xib.I couldnt find why did that crash

Resources