- iOS 总结viewcontroller中没有调用dealloc
- iOS KVO观察者模式(坑),移除观察者removeObser
- iOS viewController不会调用dealloc()不
- iOS ViewController Dealloc监听
- 4-11-对象dealloc release 发生了什么
- iOS9以前非viewController注册的通知不remov
- viewController被POP后不调用dealloc的问题
- 关于使用WKWebView时,ViewController不调
- 为什么不能在init和dealloc函数中使用accessor方
- 六、iOS-常用ViewController学习
在退出这个viewcontroller的时候,系统不调用dealloc方法,造成情况的根本原因就是viewcontroller有强引用无法释放。
1、可能是VC中有代理Delegate,设置week弱引用修饰。
@property (nonatomic,weak) id<robotDelegate>delegate;
2、VC中有block方法,造成嵌套循环引用,VC无法释放
另外如果存在定时器NSTimer,也会造成这种情况,定时器结束定时,一定要置空。
[self.timer invalidate];
self.timer = nil;
网友评论