dealloc不調用的情況

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];
        }];

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章