1

My app keeps crashing in 2 different places in any version that is lower than iOS 11.

One of the crashes is an EXC_BREAKPOINT that breaks on the appDelegate class defining line - class AppDelegate: UIResponder, UIApplicationDelegate {}

While the other crashes with EXC_BREAKPOINT on a simple segmentedControl?.removeAllSegments() (and yes I checked if the segmentedControl is empty; its not).

Whats interesting is that I never had this issue so much as 2/3 weeks ago, and I know for a fact that I changed no line of code from those 2 places.

The debugger just says this : "-[UILayoutGuide nsli_superitem]: message sent to deallocated instance 0x600000386db0"

Here is the stack trace:

0 0x000000010a79c92e _T09 30SegmentedControlViewControllerC05setupcD0yyF + 126 1 0x000000010a79c6df _T0930SegmentedControlViewControllerC05setupE0yyF + 511 2 0x000000010a5dba30 _T0929MasterStockInfoViewControllerC11viewDidLoadyyF + 624 3 0x000000010a5dbb04 _T0929MasterStockInfoViewControllerC11viewDidLoadyyFTo + 36 4 UIKit 0x000000010bec101a -[UIViewController loadViewIfRequired] + 1235 5 UIKit 0x000000010bec73a6 -[UIViewController viewWillAppear:] + 118 6 UIKit 0x000000010bef13c8 -[UINavigationController _startCustomTransition:] + 1305 7 UIKit 0x000000010bf01967 -[UINavigationController _startDeferredTransitionIfNeeded:] + 687 8 UIKit 0x000000010bf02b41 -[UINavigationController __viewWillLayoutSubviews] + 58 9 UIKit 0x000000010c0f460c -[UILayoutContainerView layoutSubviews] + 231 10 UIKit 0x000000010bde155b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268 11 QuartzCore 0x000000010ec60904 -[CALayer layoutSublayers] + 146 12 QuartzCore 0x000000010ec54526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370 13 QuartzCore 0x000000010ec543a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 14 QuartzCore 0x000000010ebe3e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 15 QuartzCore 0x000000010ec10130 _ZN2CA11Transaction6commitEv + 468 16 QuartzCore 0x000000010ec10b37 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 115 17 CoreFoundation 0x000000010e00a717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 18 CoreFoundation 0x000000010e00a687 __CFRunLoopDoObservers + 391 19 CoreFoundation 0x000000010dfef720 __CFRunLoopRun + 1200 20 CoreFoundation 0x000000010dfef016 CFRunLoopRunSpecific + 406 21 GraphicsServices 0x00000001117bba24 GSEventRunModal + 62 22 UIKit 0x000000010bd1e134 UIApplicationMain + 159 23 0x000000010a7c2257 main + 55 24 libdyld.dylib 0x000000010f6bd65d start + 1

Any information on this would be helpful, currently exploring all options. If you need more information on this, post a comment and I will get back to you instantly. Thanks

Yazan Khayyat
  • 51
  • 1
  • 2
  • 6
  • Do you have an exception breakpoint set in Xcode? Might be worth toggling that off as it could be catching non fatals. – Jacob King Jan 17 '18 at 16:58
  • I don't, its crashing on iPhone devices and the simulator. The app is in production atm and we're getting crash reports from our users. – Yazan Khayyat Jan 17 '18 at 17:02
  • `EXC_BREAKPOINT` in `appDelegate` can mean a lot of things. It could be invalid constraints (idk if you use autoLayout). It could be using unsafe unwrapping and finding a nil value. It could be using CoreGraphics in unexpected ways. You need some step to reproduce this error in order to know where it comes from (and narrow down your search). `message sent to deallocated instance` leads me to think that you might have some delegates/dataSource that are still referenced by an object that has been deallocated. I've had a similar error and assigning dataSources and delegates to nil solved it. – Francis.Beauchamp Jan 17 '18 at 17:56
  • How are you laying out your views? Snapkit? Storyboard auto-constraints?... – Nathaniel Jan 17 '18 at 17:58
  • @Nathaniel Yes Im using Storyboard auto layout – Yazan Khayyat Jan 17 '18 at 18:11

1 Answers1

1

Stupid, but I was finally able to figure it out.

I found that in my Interface Builder Document in storyboard, my deployment target was set at 11.0 for the pages I was trying to load.

I hope this helps someone :)

Yazan Khayyat
  • 51
  • 1
  • 2
  • 6