定義宏:使用前提條件次绘,定義一下宏
#define WeakSelf(weakSelf) ?__weak __typeof(&*self) ?weakSelf? = self;
#define StrongSelf(strongSelf) ?__strong __typeof(&*self) ?strongSelf = weakSelf;
最常用的方法是在一個方法中直接弱引用化
__weak ?__typeof(self) ? weakSelf = ?self;
定義宏:使用前提條件次绘,定義一下宏
#define WeakSelf(weakSelf) ?__weak __typeof(&*self) ?weakSelf? = self;
#define StrongSelf(strongSelf) ?__strong __typeof(&*self) ?strongSelf = weakSelf;
最常用的方法是在一個方法中直接弱引用化
__weak ?__typeof(self) ? weakSelf = ?self;