0

我的 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.

谢谢

4

2 回答 2

0

看来这可能是 Apple 代码中的错误。NSISEngine 显然在枚举 NSSet 时对其进行了变异,而您并没有直接这样做。

话虽如此,但这肯定是您的代码或 xib(s) 中的错误以令人困惑的方式表达自己的不良副作用。

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

于 2013-09-26T11:04:36.733 回答
0

建议:确保您正在调用UIView主队列上的方法。

由于这个原因,我遇到了这个问题。

于 2017-04-10T03:00:35.173 回答