I'm getting this error when I get a memory warning:
*** -[TheViewController_iPhone productImages]: message sent to deallocated instance
Xcode shows the error being on the line noted below:
- (void)viewDidUnload
{
[super viewDidUnload];
[self.productTimer invalidate];
//self.productTimer = nil;
for(UIView *subview in [self.productImages subviews]) { //THIS LINE IS THE ERROR
[subview removeFromSuperview];
}
}
So my question is, why is productImages (which is a scrollView) deallocated at this point? Shouldn't I get a chance to dump it's subviews?
It is defined like this:
@property (weak, nonatomic) IBOutlet UIScrollView *productImages;