【问题标题】:Strange crash issue with UIImageViewUIImageView 出现奇怪的崩溃问题
【发布时间】:2013-09-24 03:08:42
【问题描述】:

我有一个图像视图,它在我的一个项目中从服务器加载后设置为图像。我看到堆栈跟踪看起来像这样的一些时间崩溃

CoreFoundation 0x344d82a3 __exceptionPreprocess + 163   
libobjc.A.dylib 0x3c1bc97f objc_exception_throw + 31    
CoreFoundation 0x344d7d85 -[NSException name] + 1   
Foundation 0x34d78509 -[NSConcreteMapTable countByEnumeratingWithState:objects:count:] + 57 
CoreFoundation 0x34460d39 -[__NSFastEnumerationEnumerator nextObject] + 133 
CoreFoundation 0x34433f11 -[NSEnumerator countByEnumeratingWithState:objects:count:] + 49   
Foundation 0x34e88093 -[NSISEngine enumerateRows:] + 215    
Foundation 0x34e8dfdf -[NSISEngine description] + 123   
CoreFoundation 0x34448897 -[NSObject(NSObject) _copyDescription] + 35   
CoreFoundation 0x344b92db __CFStringAppendFormatCore + 11139    
CoreFoundation 0x34453fa9 CFStringCreateWithFormatAndArguments + 73 
CoreFoundation 0x344d8195 +[NSException raise:format:] + 57 
Foundation 0x34e8a11f -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 191   
Foundation 0x34e8c759 -[NSISEngine optimize] + 61   
Foundation 0x34e8c8af -[NSISEngine withAutomaticOptimizationDisabled:] + 211    
UIKit 0x36719c4f -[UIView(UIConstraintBasedLayout) removeConstraints:] + 283    
UIKit 0x362f6451 -[UIView(UIConstraintBasedLayout) invalidateIntrinsicContentSize] + 73 
UIKit 0x362f4f39 -[UIImageView setImage:] + 381 
MyApp 0x000ae369 -[DetailViewController didLoadImage:contextInfo:] (DetailViewController.m:1722)    
MyApp 0x00114a45 -[UTImageCache executeRequest:] (UTImageCache.m:296)   
Foundation 0x34deee85 __NSThread__main__ + 973  
libsystem_c.dylib 0x3c613311 _pthread_start + 309   
libsystem_c.dylib 0x3c6131d8 thread_start + 8

崩溃消息是

18-Sep-13 04:43:28 PM NSGenericException
* 集合在枚举时发生了变异。

我不确定这里有什么问题?自动布局在这里有什么问题吗?

谢谢

【问题讨论】:

  • 嗯。提问者没有写任何关于 Core Data 或线程的内容。
  • @iPatel:与核心数据无关
  • 看起来像 UIKit 内部的竞争条件。这是主线程,还是在辅助线程上执行?
  • @CouchDeveloper:它在主线程上,它是一个主线程堆栈跟踪

标签: ios uiimageview autolayout


【解决方案1】:

不,这不是自动布局。好像你有类似的东西

for (NSDictionary *dictionary in myAwesomeArray) {

}

在您的代码中。如果您遍历数组的内容,则不允许更改数组。这是你根据错误信息所做的。

【讨论】:

  • 是的,我最初的调查指出了数组问题,但我重新检查并没有显示在代码中发现任何问题。另外观察到的奇怪的事情是为什么崩溃报告指向 setImage: API?我不确定它在这里是如何关联的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-14
  • 2013-10-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多