Unbalanced calls to begin/end appearance transitio

2019-01-10 03:41发布

I have this problem when I simulate my app, its not an error or a warning but it appears in my console, has anyone ever experienced this before?

25条回答
SAY GOODBYE
2楼-- · 2019-01-10 04:13

I had lot of problem with the same issue. I solved this by this way

1) You're not using UIViewController's designated initializer initWithNibName:bundle:. Try using it instead of just init.

2) set animated:YES to a NO, and that solved the problem. eg. [self.navigationController pushViewController: viewController_Obj animated:NO];

查看更多
唯我独甜
3楼-- · 2019-01-10 04:14

I also got this at

[self dismissModalViewControllerAnimated:YES];

I changed the YES to a NO, and that solved the problem.

查看更多
We Are One
4楼-- · 2019-01-10 04:16

In my case, this error occurs when you click two tabs in a tableview very fast.

The result causes wrong titlename, back button disappear. Someone mentioned that when you push a view, set animated:NO. The error will disappear but still causes some strange behavior. It pushes two views, then you need to back twice to get back the tableview screen.

Method I tried in order to resolve this problem:

add BOOL cellSelected;

in viewWillAppear cellSelected = YES;

in didselectcell delegate if (cellSelected){cellSelected = NO; do action ; }

This helps prevent clicking two different cells very fast.

查看更多
乱世女痞
5楼-- · 2019-01-10 04:16

This was a tough one for me: I've overridden

override func shouldAutomaticallyForwardRotationMethods() -> Bool {
    return true
}

without overriding:

override func shouldAutomaticallyForwardAppearanceMethods() -> Bool {
    return true
}

in my window root navigation controller. then a child navigation controller complained when pushing another view controller with the above mentioned warning. The warning wasn't the worst, the big problem was, that there the delegate of the child navigation controller weren't called anymore. weired.

查看更多
6楼-- · 2019-01-10 04:17

In my case I was fetching NSData from NSURL inside 'viewDidLoad' method.

查看更多
ゆ 、 Hurt°
7楼-- · 2019-01-10 04:18

The situation can occur if you are adding a view with a modal view controller as a sub view. Best to use:

-(void) viewDidAppear:(BOOL)animated {
    [self presentViewController:self.yourModalVC animated:YES completion:nil];
}

It is basically saying the view life cycle is not streamlined for those viewControllers you are trying to display then.

查看更多
登录 后发表回答