ViewDidAppear and viewWillAppear do not receive call on iPad

I invoke the settings page as a form sheet above the viewController using the following code:

NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
NSString *device = [standardUserDefaults objectForKey:@"Device"];
if ([device isEqualToString:@"iPhone"]) {
    Settings_iPhone *screen = [[Settings_iPhone alloc] initWithNibName:nil bundle:nil];
    screen.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:screen animated:YES];
    [screen release];
}
if ([device isEqualToString:@"iPad"]) {    
    Settings_iPhone *screen = [[Settings_iPhone alloc] initWithNibName:@"Settings_iPad" bundle:nil];
    screen.modalPresentationStyle = UIModalPresentationFormSheet;
    screen.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:screen animated:YES];
    [screen release];
}

When the settings page is called and fired, viewDidAppear and viewWillAppear are not called on the original page only on the iPad. On the iPhone, since it is not a sheet, it works fine, and in addition, when I call the settings page on the iPad as a regular modal view instead of the form sheet, they are both called. Please help. Thank!

+3
source share
1 answer

( ). , ( , -(void)imDone:(NSObject yourValue), (dismissViewController:Animated:).

iPhone, iPad.

, .

0

All Articles