- (void)dealloc { __weak __typeof(self)weak_self = self; NSLog(@"%@", weak_self); }代码崩溃问题

来源:互联网 发布:淘宝u站管理中心 编辑:程序博客网 时间:2024/05/17 04:38
objc[4572]: Cannot form weak reference to instance (0x160f6f890) of class MFChatRoomBoardController. It is possible that this object was over-released, or is in the process of deallocation.(lldb) error: empty command(lldb) bt* thread #1: tid = 0x35914d, 0x0000000182307aac libobjc.A.dylib`_objc_trap(), queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x182307aac)  * frame #0: 0x0000000182307aac libobjc.A.dylib`_objc_trap()    frame #1: 0x0000000182307b24 libobjc.A.dylib`_objc_fatal(char const*, ...) + 88    frame #2: 0x0000000182319890 libobjc.A.dylib`weak_register_no_lock + 316    frame #3: 0x0000000182320688 libobjc.A.dylib`objc_initWeak + 224    frame #4: 0x000000010022bf8c MakeFriends`-[MFChatRoomBoardController dealloc](self=0x0000000160f6f890, _cmd="dealloc") + 36 at MFChatRoomBoardController.m:31

其中,可以在控制台明确看到这样一段描述:

objc[4572]: Cannot form weak reference to instance (0x160f6f890) of class MFChatRoomBoardController. It is possible that this object was over-released, or is in the process of deallocation.

说明不允许在 dealloc 的时候取 weak self.




阅读全文
0 0
原创粉丝点击