ios - 崩溃报告与 iOS 中的自动布局管理不善有关

标签 ios crash autolayout

我的 iOS 应用程序中有一份崩溃报告,我无法理解根本原因。但是从堆栈跟踪中我发现我的自动布局中发生了一些我无法理解的错误。有人可以帮我找出问题的原因吗?

CoreFoundation 0x342c22a3 __exceptionPreprocess + 163   
libobjc.A.dylib 0x3bfa697f objc_exception_throw + 31
CoreFoundation 0x342c1d85 -[NSException name] + 1
Foundation 0x34c7319d -[NSISEngine substituteOutAllOccurencesOfBodyVar:withExpression:] + 425
Foundation 0x34c7356b -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:] + 299
Foundation 0x34c7412b -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 203
Foundation 0x34c75fa3 -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 243
Foundation 0x34c76de9 -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 501
Foundation 0x34c7fbbf -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 395
UIKit 0x365033c1 -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 129
UIKit 0x365044a9 -[UIView(UIConstraintBasedLayout) _constraints_didChangeAutoresizingConstraintsArrayForContainedView:] + 197
UIKit 0x3650475f -[UIView(UIConstraintBasedLayout) _invalidateAutoresizingConstraints] + 79
UIKit 0x36504575 -[UIView(UIConstraintBasedLayout) _constraints_subviewDidChangeSuperview:] + 133
UIKit 0x360cc8b7 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1519
UIKit 0x360e9af7 -[UIScrollView(UIScrollViewInternal) _addContentSubview:atBack:] + 71
UIKit 0x360e993f -[UITableView(_UITableViewPrivate) _addContentSubview:atBack:] + 131
UIKit 0x360fc0a5 -[UITableView(_UITableViewPrivate) _updateVisibleHeadersAndFootersNow:] + 1701
UIKit 0x360fa50b -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1815 
UIKit 0x361117cf -[UITableView layoutSubviews] + 207
UIKit 0x360cd803 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 259
QuartzCore 0x35e77d8b -[CALayer layoutSublayers] + 215
QuartzCore 0x35e77929 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 461
QuartzCore 0x35e7885d _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 17
QuartzCore 0x35e78243 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 239
QuartzCore 0x35e78051 _ZN2CA11Transaction6commitEv + 317
QuartzCore 0x35e77eb1 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 61
CoreFoundation 0x342976cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
CoreFoundation 0x342959c1 __CFRunLoopDoObservers + 277
CoreFoundation 0x34295d17 __CFRunLoopRun + 743
CoreFoundation 0x34208ebd CFRunLoopRunSpecific + 357
CoreFoundation 0x34208d49 CFRunLoopRunInMode + 105
GraphicsServices 0x37dd02eb GSEventRunModal + 75    
UIKit 0x3611e301 UIApplicationMain + 1121
MyApp 0x00061a57 0x0005f000 + 10839
libdyld.dylib 0x3c3ddb20 start + 0

上面写着

 NSGenericException 
*** Collection <__NSSetM: 0x1e514ee0> was mutated while being enumerated.

谢谢

最佳答案

这可能是 Apple 代码中的错误。 NSISEngine 显然在枚举 NSSet 时改变了它,而你并没有直接这样做。

话虽如此,这肯定是代码或 xib 中的错误所带来的不良副作用,这些错误以令人困惑的方式表达自身。

向 Apple 报告问题,并在可能的情况下向他们发送可重现的测试用例。创建一个新的 Xcode 项目,或向他们发送当前项目的精简副本,并解释如何实现这一点。

关于ios - 崩溃报告与 iOS 中的自动布局管理不善有关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19026418/

相关文章:

iphone - ios中的物理内存管理

php - 将秤(测量体重)连接到外部设备(PC 或 iPhone)

android - 从应用程序主屏幕切换到其他 Activity 时应用程序崩溃

debugging - 如何立即终止崩溃的应用程序?

ios - 根据标签长度调整从 xib 创建的 View 大小

ios - iPhone X 将对象底部与安全区域对齐会破坏其他设备上的外观

iphone - 如何以编程方式添加 UISearchDisplay Controller ?

iPhone App 切换后崩溃,可能是由于 UIImage imageNamed

ios - 作为 subview Controller 嵌入时 UINavigationController 高度为零

ios - atos不支持armv7s吗?