1
votes

Im using a splitViewController on my iPad app but before that, i have a login and when authenticated successfully I refresh the root and detail view. The problem is that once i load the mainview nothing happens, i try by pushing any views and there is no events.

And while I load the Login view modally I get this error: "Unbalanced calls to begin/end appearance transitions for

i do the login view in the mainview (frontViewController) by using this:

-(void)displayLoginView:(BOOL)animated{
 LoginView *loginController = [[LoginView alloc] initWithNibName:@"LoginView" bundle:nil];
[self presentModalViewController:loginController animated:YES];

}

- (void)viewDidLoad{
 [super viewDidLoad];

//Add logout button

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Logout" style:UIBarButtonItemStyleBordered target:self action:@selector(logout)]; //If not already logged in, display login view [self displayLoginView:NO]; }

-(void)logout{
[self displayLoginView:YES];

}

and appdelegate.m :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

FrontViewController *frontViewController;

RearViewController *rearViewController;

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){

 frontViewController = [[FrontViewController alloc]           initWithNibName:@"FrontViewController_iPhone" bundle:nil];

 rearViewController = [[RearViewController alloc] initWithNibName:@"RearViewController_iPhone" bundle:nil];
}
else{
    frontViewController = [[FrontViewController alloc] initWithNibName:@"FrontViewController_iPad" bundle:nil];

    rearViewController = [[RearViewController alloc] initWithNibName:@"RearViewController_iPad" bundle:nil];
}

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];
    RevealController *revealController = [[RevealController alloc] initWithFrontViewController:navigationController rearViewController:rearViewController];
self.viewController = revealController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;

}

Is anyone can help me ?

Thanks a lot in advance !

1

1 Answers

13
votes

Check your viewWillAppear:animated:, viewDidAppear:animated:, viewWillDisappear:animated:, and viewDidDisappear:animated: methods, either you dont implement them or you have to call the [super viewDid....]. I had the same pb, the cause was shouldAutoRotateToInterfaceOrientation : one of them was returning false whereas the others were returning true, I set them to return the same an It was ok.