gpt4 book ai didi

ios - 由于未捕获的异常 'NSGenericException' 而终止应用程序,原因 : '*** Collection <__NSSetM...> was mutated while being enumerated.'

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:14:15 29 4
gpt4 key购买 nike

我不明白问题所在,但我猜是 Storyboard 中的问题(在我的限制下,因为有时对象不在它们必须在的位置)。

* 由于未捕获的异常“NSGenericException”而终止应用程序,原因:“*

Collection <__NSSetM: 0x7fae0b5e6900> was mutated while being enumerated.'
*** First throw call stack:

- (
0 CoreFoundation __exceptionPreprocess + 165

1 libobjc.A.dylib objc_exception_throw + 45

2 CoreFoundation __NSFastEnumerationMutationHandler + 132

3 Foundation -[NSISEngine substituteOutAllOccurencesOfBodyVar:withExpression:] + 336

4 Foundation -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:] + 330

5 Foundation -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 314

6 Foundation -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 285

7 Foundation -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 691

8 Foundation -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 275

9 Foundation -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 220

10 UIKit -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 411

11 UIKit -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:] + 30

12 UIKit [UIView(UIConstraintBasedLayout) _tryToAddConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 243

13 UIKit -[UIView(UIConstraintBasedLayout) addConstraints:]_block_invoke + 188

14 Foundation [NSISEngine withBehaviors:performModifications:] + 155

15 UIKit [UIView(UIConstraintBasedLayout) addConstraints:] + 263

16 UIKit-[UIView _setTraitStorageConstraints:] + 794

最佳答案

这不是自动布局的问题。您正在使用数组或字典或某些 NSSet 对象,这些对象在枚举(从中读取值)的同时被突变(值被添加到其中)。

这个问题主要出现在填充数组之类的东西然后重新加载 UITableViewUICollectionView

关于ios - 由于未捕获的异常 'NSGenericException' 而终止应用程序,原因 : '*** Collection <__NSSetM...> was mutated while being enumerated.' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31335026/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com