- (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
- - (void)dealloc { __weak __typeof(self)weak_self = self; NSLog(@"%@", weak_self); }代码崩溃问题
- __weak __typeof(self) weakSelf = self 和__strong __typeof(self) strongSelf = self
- 使用 __weak typeof(self) weakSelf = self 在代码块内部崩溃问题
- __weak __typeof(self)weakSelf = self和__strong __typeof(weakSelf)strongSelf = weakSelf
- __weak __typeof(self)weakSelf = self和__strong __typeof(weakSelf)strongSelf = weakSelf
- iOS开发的坑-懒加载中不要使用__weak __typeof(self)wself = self
- __weak typeof(self) _self = self;
- Dealloc 时取 weak self 时崩溃
- Dealloc 时取 weak self 引起崩溃
- IOS Q&A __weak typeof(self) weakSelf = self 是什么意思?
- __weak typeof(self) weakSelf = self的含义
- block __weak & strong self
- iOS 代理 XX.delegate = self;崩溃问题
- __weak typeof(self) weakSelf=self; __strong typeof(weakSelf) strongSelf = weakSelf;
- @weakify @strongify 对 __weak typeof(self) _self = self;的宏定义
- 【转】self.myOutlet=nil、viewDidUnload、dealloc的本质剖析
- self.delegate = self?
- self.delegate = self?
- C语言为什么要加#include<stdio.h>(C语言基础结构知识)
- eclipse 安装 Python 开发插件
- BZOJ1087 [SCOI2005]互不侵犯King 状压dp
- 【JAVA】Builder模式
- 【UOJ #30】【CF Round #278】Tourists
- - (void)dealloc { __weak __typeof(self)weak_self = self; NSLog(@"%@", weak_self); }代码崩溃问题
- 关于土地革命、土地改革、三民主义两阶段民生等五个阶段中土地问题的总结
- 归并排序java实现
- 制作jdk基础镜像
- Android进阶:基于okhttp 3 的 Android 网络层架构设计
- spring boot之web开发(二)
- JVM学习(一)——JAVA与JVM
- MAC下创建快捷方式
- 常用u-boot命令详解(全)