当我收到内存警告时出现此错误:
*** -[TheViewController_iPhone productImages]: message sent to deallocated instance
Xcode 显示错误位于以下行:
- (void)viewDidUnload
{
[super viewDidUnload];
[self.productTimer invalidate];
//self.productTimer = nil;
for(UIView *subview in [self.productImages subviews]) { //THIS LINE IS THE ERROR
[subview removeFromSuperview];
}
}
所以我的问题是,为什么此时会释放 productImages(它是一个滚动视图)?我不应该有机会转储它的子视图吗?
它是这样定义的:
@property (weak, nonatomic) IBOutlet UIScrollView *productImages;