对<RevealController:0xe9069b0>的开始/结束外观转换的不平衡调用

1 xcode login loginview uisplitviewcontroller

我在我的iPad应用程序上使用splitViewController,但在此之前,我有一个登录,并在成功验证后刷新根和详细信息视图.问题是,一旦我加载主视图没有任何反应,我尝试推送任何视图,没有事件.

当我以模态方式加载Login视图时,我收到此错误:"不平衡调用开始/结束外观转换为

我使用以下命令在主视图(frontViewController)中执行登录视图:

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

}

- (void)viewDidLoad{
 [super viewDidLoad];

//Add logout button
Run Code Online (Sandbox Code Playgroud)

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Logout"style:UIBarButtonItemStyleBordered target:self action:@selector(logout)]; //如果尚未登录,则显示登录视图[self displayLoginView:NO]; }

-(void)logout{
[self displayLoginView:YES];
Run Code Online (Sandbox Code Playgroud)

}

和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;
Run Code Online (Sandbox Code Playgroud)

}

有人可以帮帮我吗?

非常感谢提前!

Abz*_*mon 13

检查你的viewWillAppear:animated:, viewDidAppear:animated:, viewWillDisappear:animated:, and viewDidDisappear:animated:方法,你要么不实现它们,要么你必须调用[super viewDid ....].我有相同的pb,原因是shouldAutoRotateToInterfaceOrientation:其中一个返回false而其他人返回true,我设置它们返回相同的一个没关系.

  • 我完全忘了在这两种方法中调用super ...我有一个带有嵌入式导航控制器的tabBarController,并且在tabBarController中我覆盖了viewWillAppear和viewDidAppear但是没有调用[super viewWillAppear]和[super viewDidAppear]那就是导致此消息出现的原因,以及动画不流畅的原因.谢谢Abzamon,我希望你很快就能接受你的回答:) (2认同)
  • 不是正确的答案.它更多地与被叫者的外观有关,说它没有得到正确的外观程序. (2认同)