0

I have an application in which I have two tabs,

Initially first tab is opened and when I switch to next tab and do simulates memory warning

and then return to the first tab, the view gets empty even if viewDidLoad is getting called.

Kindly see to my question and please let me know if you need any clarification.

Thanks,

1 Answers1

0

I think ...

As a result of call to [super didReceiveMemoryWarning], [self setView:nil] gets automatically called.

So, I think Overriding setView: may solve your issue :

-(void)setView:(UIView*)view {
    if(view != nil || self.okayToUnloadView) {
        [super setView:view];
    }
}

I think you should go through these Two Beautiful Links :

1) Custom UIViewControllers, Their Views, and Their Memory Management

2) Efficient Memory Handling in UIViewController

Just go through this Question also.

Community
  • 1
  • 1
Bhavin
  • 27,155
  • 11
  • 55
  • 94