我收到一个奇怪的崩溃。我有一个UITableViewController通过上下文继续到另一个tableview控制器。UITapGestureRecognizer作为一个僵尸崩溃期间
当一个细胞点击,我得到一个崩溃此消息:
[UITapGestureRecognizer retain]: message sent to deallocated instance 0x8700af0
所以我跑僵尸仪器和这里就是它的显示:
# Address Category Event Type RefCt Timestamp Size Responsible Library Responsible Caller
0 0xf5f36c0 UITapGestureRecognizer Malloc 1 00:04.128.790 80 UIKit UINibDecoderDecodeObjectForValue
1 0xf5f36c0 UITapGestureRecognizer Retain 2 00:04.128.807 0 UIKit -[UIRuntimeConnection initWithCoder:]
2 0xf5f36c0 UITapGestureRecognizer Retain 3 00:04.128.880 0 UIKit UINibDecoderDecodeObjectForValue
3 0xf5f36c0 UITapGestureRecognizer Retain 4 00:04.128.959 0 UIKit -[UIRuntimeConnection initWithCoder:]
4 0xf5f36c0 UITapGestureRecognizer Retain 5 00:04.129.007 0 UIKit UINibDecoderDecodeObjectForValue
5 0xf5f36c0 UITapGestureRecognizer Retain 6 00:04.129.017 0 UIKit UINibDecoderDecodeObjectForValue
6 0xf5f36c0 UITapGestureRecognizer Retain 7 00:04.129.079 0 UIKit -[UINib instantiateWithOwner:options:]
7 0xf5f36c0 UITapGestureRecognizer Release 6 00:04.129.111 0 UIKit -[UINibDecoder finishDecoding]
8 0xf5f36c0 UITapGestureRecognizer Release 5 00:04.129.124 0 UIKit -[UINibDecoder finishDecoding]
9 0xf5f36c0 UITapGestureRecognizer Release 4 00:04.129.130 0 UIKit -[UINibDecoder finishDecoding]
10 0xf5f36c0 UITapGestureRecognizer Release 3 00:04.129.135 0 UIKit -[UINibDecoder finishDecoding]
11 0xf5f36c0 UITapGestureRecognizer Release 2 00:04.129.139 0 UIKit -[UIRuntimeConnection dealloc]
12 0xf5f36c0 UITapGestureRecognizer Release 1 00:04.129.144 0 UIKit -[UIRuntimeConnection dealloc]
13 0xf5f36c0 UITapGestureRecognizer Release 0 00:04.130.131 0 Foundation __NSFireDelayedPerform
14 0xf5f36c0 UITapGestureRecognizer Zombie -1 00:04.131.132 0 UIKit -[UINib instantiateWithOwner:options:]
的tapGestureRecognizer通过IB增加,宣布为弱。有人建议不要在ViewDidUnload中将其设置为零,所以我评论说。
现在,如果我去的标签控制器中的另一个选项卡,并做一些塞格斯那里,回来时遇到坠毁第一个表视图控制器,也没有崩溃,一切都完美塞格斯。
也是在这崩溃的控制器,我有两个不同类型的显示对象,有的只是文字,有些是图片。只有图像崩溃。文本单元格很好。
我上的iOS5 & iOS5.1运行此。在手机和模拟器上都会发生。这不会在iOS6设备或iOS6.1模拟器上崩溃。
有没有人知道这里发生了什么?
发生这种情况是因为在父节点需要释放后,您仍然保留手势识别器。您可能会以创建保留周期的方式设置“UITapGestureRecognizer”。 发表一些示例代码,我会看看它。 – jakenberg