可能的原因:
1.ViewController
中存在NSTimer
如果你的ViewController
中有NSTimer
,那么你就要注意了,因为当你调用
[NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(updateTime:)
userInfo:nil
repeats:YES];
self.playerTimer = [NSTimerscheduledTimerWithTimeInterval:1target:selfselector:@selector(playProgressAction)userInfo:nilrepeats:YES];
使用后记得销毁
[_playerTimerinvalidate];
_playerTimer =nil;
2.协议delegate
应该使用weak
修饰,否则会引起循环引用 不能释放内存
@property (nonatomic,weak)id<ceshiDelegate>delegate;
3.使用到block
的地方,block
回调中不能直接使用self
否则可能引起循环引用。
__weaktypeof(self) weakSelf =self;
_audioStream.onCompletion=^(){
[weakSelf nextButtonAction];
};
4.controller
中子view
引用Controller
,此时应该在子view
中用weak
修饰controller
@property (nonatomic, weak) UIViewController *controller;