释放 viewWillDisappear 中的对象是否安全?鉴于这些对象将再次在 viewWillAppear 上重新创建。
所以,这就是我写它的方式。这样做有什么坏处吗?
- (void)dealloc {
[self releaseObjects];
[super dealloc];
}
- (void)releaseObjects {
self.request = nil;
self.loadingOverlay = nil;
self.textView = nil;
self.label = nil;
self.endPoint = nil;
}
- (void)viewWillDisappear:(BOOL)iAnimated {
[super viewWillDisappear:iAnimated];
[self releaseObjects];
}