dealloc不调用的情况
生活随笔
收集整理的這篇文章主要介紹了
dealloc不调用的情况
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
1、沒有停止定時器
- (void)dealloc {
? ? [_timer invalidate];
? ? _timer = nil;
? ??
}
2、VC中有代理Delegate,需要設置delegate的時候,設置為weak
@property?(nonatomic,weak)?id<ZoeEatDelegate>delegate;
3、VC中有Block方法
__weak weakSelf = self;
[_marketView poppingBuyOrSellView:^(QHFinanceBuyOrSellModel *model) {
? ? ? ? ? ? __strong strongSelf = weakSelf;
? ? ? ? ? ? strongSelf.selIndex = 1;
? ? ? ? ? ? strongSelf.selectModel = model;
? ? ? ? ? ? [strongSelf popToBuyOrSellView:model.eType == 2?YES:NO];
? ? ? ? }];
?
轉載于:https://my.oschina.net/u/2519763/blog/1927027
總結
以上是生活随笔為你收集整理的dealloc不调用的情况的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP网站开启gzip压缩,php中开启
- 下一篇: php ci框架 自动验证,CodeIg