I put a function in viewWillAppear in my view controller so that it runs every time the view is loaded:
- (void)viewWillAppear:(BOOL)animated
{
[self initBasicSettings];
}
However, the function initBasicSettings is run every time a modal alert box (UIAlertView) is closed as well, which I do not want.
How do I make a function run when a view loads but not when an alert box closes? If these two events cannot be made disparate, I feel that it is not orthogonal design.
Assuming this is not a joke question. This method stub is inserted in new
UIViewControllersubclasses by default.