Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unbalanced calls to begin/end appearance transitions for <FirstViewController: 0x2a2c00>

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?

like image 967
C.Johns Avatar asked Jul 24 '11 20:07

C.Johns


2 Answers

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.

like image 116
chings228 Avatar answered Sep 23 '22 15:09

chings228


In my case it happened when I triggered [self performSegueWithIdentifier:@"SomeIdentifier" sender:self]; within a UINavigationController item's viewDidLoad method.

Moving it into the viewDidAppear method solved the problem.

The reason very likely is that in viewDidLoad not all of the fancy animations have already been finished, whereas in viewDidAppear everything's done.

like image 39
tttthomasssss Avatar answered Sep 25 '22 15:09

tttthomasssss