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

猜你喜欢

转载自my.oschina.net/u/2519763/blog/1927027