ios - 不同版本的 iOS 上的 EXC_BREAKPOINT

标签 ios swift uisegmentedcontrol nsexception uilayoutguide

在任何低于 iOS 11 的版本中,我的应用都会在两个不同的地方崩溃。

其中一个崩溃是 EXC_BREAKPOINT,它破坏了 appDelegate 类定义行 - class AppDelegate: UIResponder, UIApplicationDelegate {}

而另一个在简单的segmentedControl上因EXC_BREAKPOINT而崩溃?.removeAllSegments()(是的,我检查了segmentedControl是否为空;它不是)。

有趣的是,我在 2/3 周前从未遇到过这个问题,而且我知道我没有更改这两个地方的任何代码行。

调试器只是这样说:“-[UILayoutGuide nsli_superitem]:消息发送到已释放的实例 0x600000386db0”

这是堆栈跟踪:

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

任何有关这方面的信息都会有帮助,目前正在探索所有选项。如果您需要更多相关信息,请发表评论,我会立即回复您。 谢谢

最佳答案

虽然很蠢,但我终于明白了。

我发现在 Storyboard 中的 Interface Builder 文档中,我尝试加载的页面的部署目标设置为 11.0。

我希望这对某人有帮助:)

关于ios - 不同版本的 iOS 上的 EXC_BREAKPOINT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48306270/

相关文章:

iphone - UITableView 中的 Obj-C iPhone UISegmentedControl

ios - 在基类或扩展 Swift 的静态方法中获取派生类型的类型名称

swift - 为什么我可以在没有框架引用的情况下使用 MessageUI?

swift - 过滤 Firebase 数据 Swift

ios - 无法在静态表格 View 之上显示事件指示器

iphone - 在 iPhone 上提取 UISegmentedControl 的图像

iphone - UISegmentedControl 触摸时的色调颜色

ios - 在 Windows 上符号化 iOS 崩溃报告

ios - 检查 NSUnderlineStyle BitMask 的值

ios - GLKViewController 和 GLKView - 第二次创建时不呈现任何内容