dealloc不调用的情况
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
1、沒有停止定時(shí)器
- (void)dealloc {
? ? [_timer invalidate];
? ? _timer = nil;
? ??
}
2、VC中有代理Delegate,需要設(shè)置delegate的時(shí)候,設(shè)置為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];
? ? ? ? }];
?
轉(zhuǎn)載于:https://my.oschina.net/u/2519763/blog/1927027
總結(jié)
以上是生活随笔為你收集整理的dealloc不调用的情况的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP网站开启gzip压缩,php中开启
- 下一篇: php ci框架 自动验证,CodeIg