我的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.
由于
答案 0 :(得分:0)
看起来这可能是Apple代码中的错误。 NSISEngine显然在枚举它时改变了NSSet,而你并没有直接这样做。
尽管如此,这肯定是你的代码或xib中的一个错误的副作用,它以一种令人困惑的方式表达自己。
向Apple报告此问题,并尽可能向他们发送可重现的测试用例。创建一个新的Xcode项目,或者向他们发送当前项目的简化副本,并解释如何实现这一目标。
答案 1 :(得分:0)
Suggestion: Make sure you're calling the UIView
methods on the main queue.
I met this issue due to this reason.