您可以将值存储在 NSUserDeafualts 中。因此,在 viewDidAppear 的主 UIViewController 中:
#define SHOULD_SHOW_KEY @"shouldShowKey"
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
//Get user defaults
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
//if there is no object for SHOULD_SHOW_KEY present modal contoroler
if (![defaults objectForKey:SHOULD_SHOW_KEY]) {
//Set object for key and synchronize defaults
[defaults setObject:SHOULD_SHOW_KEY forKey:SHOULD_SHOW_KEY];
[defaults synchronize];
//Present any custom modal controller
UIViewController *yourModalVC=[self.storyboard instantiateViewControllerWithIdentifier:@"myModalVC"];
[self presentModalViewController:yourModalVC animated:YES];
}
}
希望这有帮助。