Crash on iOS 10.3.1 when inserting a UICollectionViewCell - ios

I am moving across some content across from a different application, and doing so required me to move a NIB. Moving this NIB has caused a crash on iOS 10 which was occurring every time - this crash had no search results on stack overflow or much other information online.
I am reloading the cell using this code:
collectionView?.performBatchUpdates({
collectionView?.insertItems(at: [ indexPath ])
}, completion: nil)
Specifically, when inserting the collection view cell, this is the error:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x0000000105015acb libobjc.A.dylib`objc_msgSend + 11
frame #1: 0x0000000104c5506f Foundation`-[NSLayoutAnchor nsli_lowerIntoExpression:withCoefficient:forConstraint:] + 376
frame #2: 0x0000000104b21c11 Foundation`-[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 99
frame #3: 0x0000000104b1b56e Foundation`-[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 121
frame #4: 0x000000010721fc71 UIKit`__57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 454
frame #5: 0x0000000104b2182b Foundation`-[NSISEngine withBehaviors:performModifications:] + 155
frame #6: 0x000000010721fa84 UIKit`__57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 604
frame #7: 0x000000010721f800 UIKit`-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 223
frame #8: 0x000000010721e933 UIKit`-[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 447
frame #9: 0x0000000107211499 UIKit`-[UIView(UIConstraintBasedLayout) _layoutEngine_windowDidChange] + 130
frame #10: 0x0000000106917909 UIKit`-[UIView(Internal) _didMoveFromWindow:toWindow:] + 209
frame #11: 0x000000010690ab96 UIKit`__45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 151
frame #12: 0x000000010690aa7d UIKit`-[UIView(Hierarchy) _postMovedFromSuperview:] + 828
frame #13: 0x000000010691aa0a UIKit`-[UIView(Internal) _addSubview:positioned:relativeTo:] + 1927
frame #14: 0x000000010718aef7 UIKit`-[UICollectionView _addControlledSubview:atZIndex:] + 571
frame #15: 0x000000010718dec0 UIKit`-[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 1881
frame #16: 0x000000010718d761 UIKit`-[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 35
frame #17: 0x00000001071ac194 UIKit`__51-[UICollectionView _viewAnimationsForCurrentUpdate]_block_invoke.1941 + 564
frame #18: 0x00000001071a95bb UIKit`-[UICollectionView _viewAnimationsForCurrentUpdate] + 5141
frame #19: 0x00000001071aebf3 UIKit`__71-[UICollectionView _updateWithItems:tentativelyForReordering:animator:]_block_invoke.2012 + 197
frame #20: 0x000000010691308e UIKit`+[UIView(Animation) performWithoutAnimation:] + 90
frame #21: 0x00000001071ad82d UIKit`-[UICollectionView _updateWithItems:tentativelyForReordering:animator:] + 3856
frame #22: 0x00000001071a7b33 UIKit`-[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:] + 17030
frame #23: 0x00000001071b01cd UIKit`-[UICollectionView _endUpdatesWithInvalidationContext:tentativelyForReordering:animator:] + 71
frame #24: 0x00000001071b0514 UIKit`-[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:] + 437
frame #25: 0x00000001071b033c UIKit`-[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 91
frame #26: 0x00000001071b02be UIKit`-[UICollectionView _performBatchUpdates:completion:invalidationContext:] + 74
frame #27: 0x00000001071b0213 UIKit`-[UICollectionView performBatchUpdates:completion:] + 53
* frame #28: 0x00000001046f44be IndexListSampleApp`closure #1 in RemoteIndexListContent.willDisplay(result=success, self=0x00006080000d0fb0, collectionView=0x00007f924588e600, indexPath=2 indices) at RemoteIndexListContent.swift:98
frame #29: 0x00000001046f464d IndexListSampleApp`partial apply for closure #1 in RemoteIndexListContent.willDisplay(itemAtIndexPath:cell:collectionView:) at RemoteIndexListContent.swift:0
frame #30: 0x000000010458f528 IndexListSampleApp`specialized closure #1 in RemoteLiveEventTileContentProvider.loadContent(fixtures=<unavailable>, self=<unavailable>, completion=0x00000001046f45d0 IndexListSampleApp`partial apply forwarder for closure #1 (Result.Result<IndexListFoundation.IndexListContent>) -> () in IndexListFoundation.RemoteIndexListContent.willDisplay(itemAtIndexPath: Foundation.IndexPath, cell: __ObjC.UICollectionViewCell, collectionView: __ObjC.UICollectionView) -> () at RemoteIndexListContent.swift) at RemoteLiveEventTileContentProvider.swift:49 [opt]
frame #31: 0x000000010458cc0b IndexListSampleApp`partial apply for closure #1 in RemoteLiveEventTileContentProvider.loadContent(completion:) [inlined] closure #1 (Swift.Optional<Swift.Array<Core.Fixture>>, Swift.Optional<Swift.Error>) -> () in LiveEvent.RemoteLiveEventTileContentProvider.loadContent(completion: (Result.Result<IndexListFoundation.IndexListContent>) -> ()) -> () at RemoteLiveEventTileContentProvider.swift:0 [opt]
This only happens on iOS 10.2.1 -> 10.3.1 - OK on iOS 9 and iOS 11. I am using Xcode 9.0.1, the crash is also reproducible on Xcode 9.2.

The fix was quite simple. I had "Use Safe Area Layout Guides" ticked - this clearly has an underlying issue on iOS 10.2.1 -> 10.3.1. Unticking this option resolves the crash!

Related

App crashed when launched in Xcode 13.2.1 in iOS 15.2 simulator in debug mode

I recently downloaded Xcode 13.2.1. When I run the application it is crashing in iOS 15.2 in simulator while debugging. Also when already installed app i am launching by tapping on app icon it is running fine.
Here are backtrace:
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
frame #0: 0x00007fff20198d24 libobjc.A.dylib`class_createInstance + 125
frame #1: 0x00007fff20112f66
frame #2: 0x00007fff20118c19
frame #3: 0x00007fff265e625d
frame #4: 0x00007fff2011383a
frame #5: 0x00007fff20114a0d
frame #6: 0x00007fff265ff8c6
frame #7: 0x00007fff265ffc0b
frame #8: 0x00007fff265ff214
frame #9: 0x00007fff2011383a
frame #10: 0x00007fff20114a0d
frame #11: 0x00007fff265ff1ee
frame #12: 0x00007fff35e0245b NetworkExtension`+[NEFilterSource filterRequired] + 35
frame #13: 0x00007fff298dde70 WebKit`WebKit::WebPageProxy::createNetworkExtensionsSandboxExtensions(WebKit::WebProcessProxy&) + 52
frame #14: 0x00007fff298ddc99 WebKit`WebKit::WebPageProxy::addPlatformLoadParameters(WebKit::WebProcessProxy&, WebKit::LoadParameters&) + 95
frame #15: 0x00007fff29988216 WebKit`WebKit::WebPageProxy::loadRequestWithNavigationShared(WTF::Ref<WebKit::WebProcessProxy, WTF::RawPtrTraits<WebKit::WebProcessProxy> >&&, WTF::ObjectIdentifier<WebCore::PageIdentifierType>, API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object*, WebCore::ShouldTreatAsContinuingLoad, std::__1::optional<WebKit::NavigatingToAppBoundDomain>, std::__1::optional<WebKit::WebsitePoliciesData>&&, std::__1::optional<WTF::ObjectIdentifier<WebKit::NetworkResourceLoadIdentifierType> >) + 1060
frame #16: 0x00007fff29987d0d WebKit`WebKit::WebPageProxy::loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object*) + 787
frame #17: 0x00007fff2983ac3b WebKit`-[WKWebView loadRequest:] + 137
frame #18: 0x000000010c7448fa SonyLIV`___lldb_unnamed_symbol7230$$SonyLIV + 73
frame #19: 0x000000010c6fee83 SonyLIV`___lldb_unnamed_symbol5787$$SonyLIV + 88
frame #20: 0x000000010c6ff502 SonyLIV`GADDispatchAsyncSafeMainQueue + 45
frame #21: 0x000000010c6fec3d SonyLIV`___lldb_unnamed_symbol5780$$SonyLIV + 211
frame #22: 0x000000010c72aa00 SonyLIV`___lldb_unnamed_symbol6756$$SonyLIV + 622
frame #23: 0x000000010c73e9fe SonyLIV`___lldb_unnamed_symbol7124$$SonyLIV + 207
frame #24: 0x0000000114e1e848 libdispatch.dylib`_dispatch_call_block_and_release + 12
frame #25: 0x0000000114e1fa2c libdispatch.dylib`_dispatch_client_callout + 8
frame #26: 0x0000000114e2e1f1 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1197
frame #27: 0x00007fff2036c84d CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
frame #28: 0x00007fff203670aa CoreFoundation`__CFRunLoopRun + 2772
frame #29: 0x00007fff203660f3 CoreFoundation`CFRunLoopRunSpecific + 567
frame #30: 0x00007fff2c995cd3 GraphicsServices`GSEventRunModal + 139
frame #31: 0x00007fff25059f42 UIKitCore`-[UIApplication _run] + 928
frame #32: 0x00007fff2505eb5e UIKitCore`UIApplicationMain + 101
frame #33: 0x000000010ba20e9f SonyLIV`main at AppDelegate.swift:18:7
frame #34: 0x000000011247dee9 dyld_sim`start_sim + 10
frame #35: 0x000000011e4ea4fe dyld`start + 462
This crash I am getting in simulator only in device it is running fine.
Thank you :)
Reason
The error here is EXC_BAD_ACCESS, and it is occurring because of ___lldb_unnamed_symbol.
Fix
As there is no minimally reproducible code or the complete crash log.
Assuming you are using the Debug schema check if a framework in your project had been compiled for Release builds, if that's the case change the schema to Debug for that framework.

Xcode 9 & Swift 4 - Unexpected Crash When Presenting View Controller

I am getting a crash only when using Xcode 9 Beta 1 and Swift 4.
I am trying to present a view controller but an exception is thrown, even though I have several breakpoints to catch all exceptions Xcode doesn't stop anywhere.
Using lldb I was able to print the exception since Xcode didn't do it.
Here is what I got:
(lldb) po $arg1
-[UIDeviceRGBColor pointSize]: unrecognized selector sent to instance 0x60000067a6c0
(null)
Here is the stack trace:
And the backtrace:
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1 5.1
* frame #0: 0x00000001090e60f1 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000109806494 CoreFoundation`-[NSObject(NSObject) doesNotRecognizeSelector:] + 132
frame #2: 0x00000001096ff858 CoreFoundation`___forwarding___ + 1432
frame #3: 0x00000001096ff238 CoreFoundation`__forwarding_prep_0___ + 120
frame #4: 0x0000000112e9f350 UIFoundation`__NSStringDrawingEngine + 3564
frame #5: 0x0000000112ea32b2 UIFoundation`-[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:context:] + 787
frame #6: 0x000000010a84e96e UIKit`-[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 1022
frame #7: 0x000000010a84e33b UIKit`-[UILabel textRectForBounds:limitedToNumberOfLines:] + 68
frame #8: 0x000000010a8543c9 UIKit`-[UILabel _intrinsicSizeWithinSize:] + 167
frame #9: 0x000000010b242b24 UIKit`-[UITextField _intrinsicSizeWithinSize:] + 238
frame #10: 0x000000010b0b61ab UIKit`-[UIView(UIConstraintBasedLayout) intrinsicContentSize] + 37
frame #11: 0x000000010b0b6a00 UIKit`-[UIView(UIConstraintBasedLayout) _generateContentSizeConstraints] + 35
frame #12: 0x000000010b0b6643 UIKit`-[UIView(UIConstraintBasedLayout) _updateContentSizeConstraints] + 262
frame #13: 0x000000010b0c0fef UIKit`-[UIView(AdditionalLayoutSupport) _updateSystemConstraints] + 99
frame #14: 0x000000010b0bf8b7 UIKit`-[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 161
frame #15: 0x000000010b0bfebf UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 1286
frame #16: 0x000000010b0bfd3e UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 901
frame #17: 0x000000010b0bfd3e UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 901
frame #18: 0x000000010b0bfd3e UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 901
frame #19: 0x000000010b0bfd3e UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 901
frame #20: 0x0000000107d1d1a1 Foundation`-[NSISEngine withBehaviors:performModifications:] + 131
frame #21: 0x000000010b0c06f0 UIKit`__100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 90
frame #22: 0x000000010b0bef7e UIKit`-[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104
frame #23: 0x000000010b0c025f UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 160
frame #24: 0x000000010b0c134f UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 344
frame #25: 0x000000010a66f414 UIKit`-[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 159
frame #26: 0x000000010a599e09 UIKit`-[UIPickerView layoutSubviews] + 189
frame #27: 0x000000010a59d697 UIKit`-[UIPickerView selectedRowInComponent:] + 45
frame #28: 0x000000010a5982fc UIKit`-[UIPickerView _updateSelectedRows] + 143
frame #29: 0x000000010a598396 UIKit`-[UIPickerView didMoveToWindow] + 101
frame #30: 0x000000010a67a8e1 UIKit`-[UIView(Internal) _didMoveFromWindow:toWindow:] + 1701
frame #31: 0x000000010a67a530 UIKit`-[UIView(Internal) _didMoveFromWindow:toWindow:] + 756
frame #32: 0x000000010a67a530 UIKit`-[UIView(Internal) _didMoveFromWindow:toWindow:] + 756
frame #33: 0x000000010a692e45 UIKit`-[UIScrollView _didMoveFromWindow:toWindow:] + 84
frame #34: 0x000000010a67a530 UIKit`-[UIView(Internal) _didMoveFromWindow:toWindow:] + 756
frame #35: 0x000000010a66d259 UIKit`__45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 151
frame #36: 0x000000010a66d140 UIKit`-[UIView(Hierarchy) _postMovedFromSuperview:] + 828
frame #37: 0x000000010a67d4ad UIKit`-[UIView(Internal) _addSubview:positioned:relativeTo:] + 1917
frame #38: 0x000000010a71a82b UIKit`-[UITransitionView transition:fromView:toView:removeFromView:] + 1541
frame #39: 0x000000010b2c9f29 UIKit`-[UIViewControllerBuiltinTransitionViewAnimator animateTransition:] + 1712
frame #40: 0x000000010a720845 UIKit`__56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 3003
frame #41: 0x000000010a5c46cc UIKit`_runAfterCACommitDeferredBlocks + 318
frame #42: 0x000000010a5b2cef UIKit`_cleanUpAfterCAFlushAndRunDeferredBlocks + 280
frame #43: 0x000000010a5e3091 UIKit`_afterCACommitHandler + 137
frame #44: 0x000000010971f507 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #45: 0x000000010971f45e CoreFoundation`__CFRunLoopDoObservers + 430
frame #46: 0x00000001097038f4 CoreFoundation`__CFRunLoopRun + 1332
frame #47: 0x0000000109703149 CoreFoundation`CFRunLoopRunSpecific + 409
frame #48: 0x000000011182c9d7 GraphicsServices`GSEventRunModal + 62
frame #49: 0x000000010a5b891d UIKit`UIApplicationMain + 159
frame #50: 0x00000001076a1cc7 GradePoint`main at AppDelegate.swift:13
frame #51: 0x000000010d224b65 libdyld.dylib`start + 1
I understand it has to do with an unrecognized selector, but I am not doing anything with UIDeviceRGBColor or PointSize.
Not really sure what could be going on, this all works just fine when I switch over to Xcode 8.
If you would like to reproduce feel free to clone the project here and switch to the features/ios11 branch. All you have to do is finish the intro screen, and click the + button. The crash will happen instantly afterward. Run using Xcode 9 Beta 1
I understand this just might be a beta bug, but if anyone has more experience with this I would appreciate some help, if not, at least help with how to file an Xcode bug report since I've never done one.
Thanks!
UIDeviceRGBColor is technically a UIColor. pointSize is a method on UIFont. The bug happens when performing layout of a UILabel.
The most probable cause is that you are assigning a UIColor instance to a UILabel.font.
If you have an attributed string, it would be caused e.g. by attributes:
let attributes: [String: Any] = [NSFontAttributeName: UIColor.black]
Note that since attributes take Any values, there is no type checking and this can happen in Swift.
I tried downloading your code and reproducing the crash but I'm not able to see a crash. I've tried running your code on the iPhone 7 Plus simulator and on my iPhone 6S and it works fine both places. (I'm running your project on Xcode 9 Beta 1)
Could you share any more details on the environment you're running your code in? Perhaps the Swift version setting you're using (Select your target > Build Settings > Swift Language Version) or whether you've performed a Swift 4 migration? I'll be happy to look into it further.
Meanwhile, here's how to file a bug report with Apple.
[I know this content should be posted as a comment rather than an answer but I don't have enough reputation points to do that at the time of writing.]

iOS App crashes only when attached to the debugger

i have an issue where my app crashes when attached to the debugger in just one case. My App downloads json data and transform it into core data objects. For this purpose i start a background thread to load it and have a successHandler handling the import:
RemoteConnectionService.sharedInstance.sendRequest(UserRequest(userID: user!.webID.integerValue), successHandler: { requestHandler, result in
var userData = result["user"] as! [String: AnyObject]
self.user?.update(userData)
self.tableView.reloadData()
}, errorHandler: nil)
this works everywhere as expected. the successHandler is called on the main thread, core data gets updated and all. but when doing this special request (it happens always and only with this request) Xcode stop pointing to
class AppDelegate: UIResponder, UIApplicationDelegate
with no specific failure reason. here's the backtrace (via bt):
* thread #1: tid = 0x6ab4b, 0x00000001051b19c0 libobjc.A.dylib`objc_release + 16, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00000001051b19c0 libobjc.A.dylib`objc_release + 16
frame #1: 0x00000001051b28cd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 591
frame #2: 0x00000001082348d8 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 207
frame #3: 0x0000000108234a37 CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
frame #4: 0x00000001081043a7 CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 107
frame #5: 0x00000001081d1891 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 273
frame #6: 0x00000001080ef6e6 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 72
frame #7: 0x00000001057c13d4 CoreFoundation`CFArrayApplyFunction + 68
frame #8: 0x00000001080ef5a7 CFNetwork`RunloopBlockContext::perform() + 133
frame #9: 0x00000001080ef3e6 CFNetwork`MultiplexerSource::perform() + 256
frame #10: 0x00000001080ef1fc CFNetwork`MultiplexerSource::_perform(void*) + 72
frame #11: 0x00000001057ee4b1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #12: 0x00000001057e437d CoreFoundation`__CFRunLoopDoSources0 + 269
frame #13: 0x00000001057e39b4 CoreFoundation`__CFRunLoopRun + 868
frame #14: 0x00000001057e33e6 CoreFoundation`CFRunLoopRunSpecific + 470
frame #15: 0x000000010abdba3e GraphicsServices`GSEventRunModal + 161
frame #16: 0x00000001063cab60 UIKit`UIApplicationMain + 1282
* frame #17: 0x00000001049556b7 App`main + 135 at AppDelegate.swift:13
frame #18: 0x00000001088fd145 libdyld.dylib`start + 1
What i don't get here is that when trying to profile it in instruments or just running it in the simulator without Xcode it works just fine. On the device it crashes on that particular request no matter what.
device backtrace looks a bit different:
* thread #1: tid = 0x19e6ab, 0x0000000192490174 libobjc.A.dylib`objc_release + 20, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x13723bec8)
frame #0: 0x0000000192490174 libobjc.A.dylib`objc_release + 20
frame #1: 0x0000000192491724 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
frame #2: 0x00000001817d2e08 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 216
frame #3: 0x00000001817d2f7c CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60
frame #4: 0x00000001816a78e4 CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 104
frame #5: 0x0000000181770540 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 104
frame #6: 0x0000000181693b54 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 76
frame #7: 0x0000000181c10aac CoreFoundation`CFArrayApplyFunction + 68
frame #8: 0x0000000181693a00 CFNetwork`RunloopBlockContext::perform() + 136
frame #9: 0x00000001816938b4 CFNetwork`MultiplexerSource::perform() + 312
frame #10: 0x00000001816936e0 CFNetwork`MultiplexerSource::_perform(void*) + 68
frame #11: 0x0000000181ce69ec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #12: 0x0000000181ce5c90 CoreFoundation`__CFRunLoopDoSources0 + 264
frame #13: 0x0000000181ce3d40 CoreFoundation`__CFRunLoopRun + 712
frame #14: 0x0000000181c110a4 CoreFoundation`CFRunLoopRunSpecific + 396
frame #15: 0x000000018adab5a4 GraphicsServices`GSEventRunModal + 168
frame #16: 0x0000000186542aa4 UIKit`UIApplicationMain + 1488
* frame #17: 0x0000000100069c8c App`main + 164 at AppDelegate.swift:13
frame #18: 0x0000000192ae6a08 libdyld.dylib`start + 4
Any suggestions on how to debug this? Very much appreciated :)

App crashes on launch on iOS 6 but working fine on iOS 7

I developed an app in Xcode 5. Until now I only tested it on a device running iOS 7. I tried running it on another device with iOS 6 but it crashes on launch in the main function without any error message in the console. The deployment target is 6.0 and I've chosen Standard architectures(armv7, armv7s) in the Build Settings.
I also checked the code for methods available only for iOS 7. Could it be that I accidentally skipped one? As for as I know I should get an error message if it doesn't recognise the method.
I'm not a newbie on iOS development, but something is skipping my attention. Do you have any idea what it could be?
I would really appreciate your help. Thank you.
UPDATE:
This is it... Could it be something in the plist...?
I finally got to the bottom of this problem thanks to "OC Rickard". Writing 'bt' in the console, this was the output:
thread #1: tid = 0x2503, 0x38a8b454 CoreFoundationCFDictionaryRemoveValue + 12, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x38a8b454 CoreFoundationCFDictionaryRemoveValue + 12
frame #1: 0x36e58e28 GraphicsServicesRemoveFont + 740
frame #2: 0x36e58868 GraphicsServicesAddFontsFromCGFontAndPath + 332
frame #3: 0x36e58660 GraphicsServicesAddFontsFromURLOrPath + 156
frame #4: 0x36e59e12 GraphicsServicesInitialize_block_invoke_0 + 378
frame #5: 0x36e3a4b6 libdispatch.dylib_dispatch_client_callout + 22
frame #6: 0x36e403f6 libdispatch.dylibdispatch_once_f$VARIANT$mp + 42
frame #7: 0x36e57f7a GraphicsServicesInitialize + 78
frame #8: 0x36e57fc0 GraphicsServicesGSFontCreateWithName + 56
frame #9: 0x31c7cfea UIKitUINewFont + 58
frame #10: 0x31c7cf9a UIKit+[UIFont systemFontOfSize:traits:] + 18
frame #11: 0x31fa608c UIKit-[UIStatusBarServiceItemView _contentsImageFromString:withWidth:letterSpacing:forStyle:] + 124
frame #12: 0x31cd888a UIKit-[UIStatusBarServiceItemView _serviceContentsImageForStyle:] + 362
frame #13: 0x31cd84ac UIKit-[UIStatusBarServiceItemView updateContentsAndWidth] + 140
frame #14: 0x31cd823e UIKit-[UIStatusBarItemView initWithItem:data:actions:style:] + 306
frame #15: 0x31cd7f90 UIKit-[UIStatusBarLayoutManager _createViewForItem:withData:actions:] + 108
frame #16: 0x31c877de UIKit-[UIStatusBarLayoutManager _prepareEnabledItemType:withEnabledItems:withData:actions:itemAppearing:itemDisappearing:] + 134
frame #17: 0x31c8770e UIKit-[UIStatusBarLayoutManager prepareEnabledItems:withData:actions:] + 82
frame #18: 0x31f9e910 UIKit-[UIStatusBarForegroundView _setStatusBarData:actions:animated:] + 168
frame #19: 0x31c87662 UIKit-[UIStatusBarForegroundView setStatusBarData:actions:animated:] + 722
frame #20: 0x31cd7516 UIKit-[UIStatusBar _prepareToSetStyle:animation:] + 794
frame #21: 0x31c8978e UIKit-[UIStatusBar requestStyle:animationParameters:] + 558
frame #22: 0x31c894a8 UIKit-[UIStatusBar requestStyle:animated:] + 84
frame #23: 0x31cd2f6e UIKit-[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] + 258
frame #24: 0x31cd2736 UIKit-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 430
frame #25: 0x31c7ac38 UIKit-[UIApplication handleEvent:withNewEvent:] + 1004
frame #26: 0x31c7a6cc UIKit-[UIApplication sendEvent:] + 72
frame #27: 0x31c7a11a UIKit_UIApplicationHandleEvent + 6154
frame #28: 0x36e5d5a2 GraphicsServices_PurpleEventCallback + 590
frame #29: 0x36e5d1d2 GraphicsServicesPurpleEventCallback + 34
frame #30: 0x38b1d172 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 34
frame #31: 0x38b1d116 CoreFoundation__CFRunLoopDoSource1 + 138
frame #32: 0x38b1bf98 CoreFoundation__CFRunLoopRun + 1384
frame #33: 0x38a8eebc CoreFoundationCFRunLoopRunSpecific + 356
frame #34: 0x38a8ed48 CoreFoundationCFRunLoopRunInMode + 104
frame #35: 0x31cd147c UIKit-[UIApplication _run] + 668
frame #36: 0x31cce2f8 UIKitUIApplicationMain + 1120
frame #37: 0x00085f96 iSpyLovemain(argc=1, argv=0x2fd98d20) + 110 at main.m:16
frame #38: 0x362fab20 libdyld.dylibstart + 4
I had a font declared in the plist file which had .dfont extension. Apparently iOS 6 didn't like this. Thank you "OC Rickard", and thanks to all of you guys for taking interest in my problem.

View controller uses one nib fine but crashes with another

I'm working on a universal app and the iPhone version works just fine. I created a new nib for iPad and set the files owner to be the viewcontroller class. The I connected all the IBOutlets and IBActions. When I run the app on an iPad (and in the iPad simulator) it crashes when I touch any of the controls. I tried setting break points in the IBActions for each but it doesn't even make it to those before the crash happens. What's going on?
Backtrace:
* thread #1: tid = 0x1f03, 0x0189809b libobjc.A.dylibobjc_msgSend + 15, stop reason = EXC_BAD_ACCESS (code=2, address=0x15)
frame #0: 0x0189809b libobjc.A.dylibobjc_msgSend + 15
frame #1: 0x0020f14e UIKit-[UIApplication sendAction:to:from:forEvent:] + 96
frame #2: 0x0020f0e6 UIKit-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
frame #3: 0x002b5ade UIKit-[UIControl sendAction:to:forEvent:] + 66
frame #4: 0x002b5fa7 UIKit-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503
frame #5: 0x002b5b13 UIKit-[UIControl sendActionsForControlEvents:] + 48
frame #6: 0x00304462 UIKit-[UISegmentedControl _setSelectedSegmentIndex:notify:] + 684
frame #7: 0x00305dd0 UIKit-[UISegmentedControl touchesBegan:withEvent:] + 1026
frame #8: 0x002342cf UIKit-[UIWindow sendTouchesForEvent:] + 272
frame #9: 0x002345e6 UIKit-[UIWindow sendEvent:] + 273
frame #10: 0x0021adc4 UIKit-[UIApplication sendEvent:] + 464
frame #11: 0x0020e634 UIKit_UIApplicationHandleEvent + 8196
frame #12: 0x021c0ef5 GraphicsServicesPurpleEventCallback + 1274
frame #13: 0x012a1195 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #14: 0x01205ff2 CoreFoundation_CFRunLoopDoSource1 + 146
frame #15: 0x012048da CoreFoundation__CFRunLoopRun + 2218
frame #16: 0x01203d84 CoreFoundationCFRunLoopRunSpecific + 212
frame #17: 0x01203c9b CoreFoundationCFRunLoopRunInMode + 123
frame #18: 0x021bf7d8 GraphicsServicesGSEventRunModal + 190
frame #19: 0x021bf88a GraphicsServicesGSEventRun + 103
frame #20: 0x0020c626 UIKitUIApplicationMain + 1163
frame #21: 0x00001d8d gravity`main + 141 at main.m:16
Turns out the view controller wasn't being retained due to ARC. So when I went back to send messages to it it crashed.

Resources