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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10579762/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:18:50  来源:igfitidea点击:

Unbalanced calls to begin/end appearance transitions for <RevealController: 0xe9069b0>

xcodeloginuisplitviewcontrollerloginview

提问by user1041614

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.

我在我的 iPad 应用程序上使用了 splitViewController,但在此之前,我有一个登录名,成功通过身份验证后,我刷新了根视图和详细信息视图。问题是,一旦我加载了主视图,就什么也没有发生,我尝试推送任何视图并且没有事件。

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:

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

-(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]; }

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

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

}

}

and appdelegate.m :

和 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 !

非常感谢!

回答by Abzamon

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.

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