I want to know something aboutViewWillAppear
.I have a viewwillappar method for data refreshing. What I want to do is when this viewcontroller push from the previous one this refreshing should not be happen. (when initially loading this controller viewwillappear should not be call). Is this possible? If so how can I do that?
Please help me Thanks
viewWillAppear will always be called when the view appears
You can use an instance variable to make sure it is not called the first time i.e.
@implmentation ViewController {
BOOL _firstLoad
}
- (void)viewDidLoad
{
[super viewDidLoad];
_firstLoad = YES;
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if (!_firstLoad) {
// do what you want to do when it is not the first load
}
_firstLoad = NO;
}