在delegate = self;处崩溃

2019-12-31  本文已影响0人  gersces

崩溃原因:Thread 1: signal SIGABRT

log信息:Cannot form weak reference to instance (0x7ff907d60730) of class xxx. It is possible that this object was over-released, or is in the process of deallocation.

在"xxx"的decalloc方法,或者引用"xxx"的class的decalloc方法(依次向上找引用的class的decalloc方法)使用了懒加载,并且在懒加载方法里面设置了delegate。

解决方法:

①在decalloc方法里面,不要使用"self.xxx",使用"_xxx";

②不要在懒加载方法里面设置好delegate;

上一篇 下一篇

猜你喜欢

热点阅读