I’m wondering if it’s possible for a view to prevent itself from opening as a modal view before certain data is loaded.
For instance:
addTimeViewController = [[[AddTimeViewController alloc] initWithNibName:@"AddTimeViewController" bundle:nil] autorelease];
addTimeViewNavigationController = [[[UINavigationController alloc] initWithRootViewController:addTimeViewController] autorelease];
Item *item = (Item *)[_dataModel.items objectAtIndex:_currentEditCell];
[self.navigationController presentModalViewController:addTimeViewNavigationController animated:YES];
[addTimeViewController updateTime:item];
This will open the AddTimeViewController as a modal, but the AddTimeViewController has to load certain data before it’s being displayed.
Would there be a way to prevent it from opening itself in a modal view before that data is loaded?
I want to do this inside the AddTimeViewController itself, I don’t want to send out notifications and do it that way.
You shouldn’t prevent a viewController from loading itself, instead as the ViewController opens, you could add some intermediate views that will tell the user that you are currently loading data from a remote source