"Unbalanced Calls to Begin/End Appearance Transitions for Detailviewcontroller" When Pushing More Than One Detail View Controller

Unbalanced calls to begin/end appearance transitions for DetailViewController when pushing more than one detail view controller

"The unbalanced calls to begin/end appearance transitions"

occurs when you try and display a new viewcontroller before the current view controller is finished displaying. You can reproduce it by navigating in viewWillAppear.

Basically you are trying to push two view controllers onto the stack at almost the same time. Suggest you maintain a queue in the tableview controller which maintains a list of the detail views which need displaying. Push one at a time on to the stack and check on exit from the current detail view whether there are any queued detail views which need displaying.

This kind of navigation is going to be confusing for the user. It may be better to consider making your detail view support multiple items.

(2022) Getting error: Unbalanced calls to begin/end appearance transitions for

You're missing a line...

    guard let scene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: scene)
let nav = UINavigationController(rootViewController: LoginController())
window.rootViewController = nav

// missing this line
self.window = window

window.makeKeyAndVisible()

Unbalanced calls to begin/end appearance transitions for

Without seeing more of the surrounding code I can't give a definite answer, but I have two theories.

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

  2. Also, self may be one of the tab bar controller's view controllers. Always present view controllers from the topmost view controller, which means in this case ask the tab bar controller to present the overlay view controller on behalf of the view controller. You can still keep any callback delegates to the real view controller, but you must have the tab bar controller present and dismiss.

Unbalanced calls to begin/end appearance transitions with custom segue

Looks like this behaviour is the result of some - as of yet - undocumented change in recent iOS releases.
Getting frustrated with your exact issue and the lack of satisfying answers I've come up with this:

// create a UIImageView containing a UIImage of `view`'s contents
func createMockView(view: UIView) -> UIImageView {
UIGraphicsBeginImageContextWithOptions(view.frame.size, true, UIScreen.mainScreen().scale)

view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true)
let image = UIGraphicsGetImageFromCurrentImageContext()

UIGraphicsEndImageContext()
return UIImageView(image: image)
}

override func perform() {

let src:UIViewController = self.sourceViewController as! UIViewController
let dstn:UIViewController = self.destinationViewController as! UIViewController
let mock = createMockView(dstn.view)

src.view.addSubview(mock)
mock.alpha = 0

UIView.animateWithDuration(0.75, delay: 0.1, options: UIViewAnimationOptions.TransitionCrossDissolve,
animations: { () -> Void in
mock.alpha = 1
},
completion: { (finished) -> Void in
src.presentViewController(dstn, animated: false, completion: { mock.removeFromSuperView()})
})
}

createMockView() will create a UIImageView containing a snapshot of the destination VCs contents and use that to do the transition animation.
Once the transition is finished the real destination VC is presented without animation causing a seamless transition between both. Finally once the presentation is done the mock view is removed.

Keep getting Unbalanced calls to begin/end appearance transitions for error

I found the answer this morning in another stackoverflow question. The answer can be found here.

When I had originally setup the Push Segue, I clicked on and dragged from a button, and was also calling the performSegueWIthIdentifier method inside that button's IBAction method implementation. This was causing 2 identical push segues to be executed on the button press. I just left my method call in the IBAction, deleted the old push segue, and created a new push segue only this time I clicked on and dragged from the entire View Controller instead of it's button.

Unbalanced calls to begin/end appearance transitions warning when push a view in a modal way in XCode 4 with Storyboard

It sounds like you may be performing the segue in -viewWillAppear: thus generating two -viewWillAppear: messages without 2 corresponding -viewDidAppear messages.

Try performing the segue in -viewDidAppear.

Warning: Unbalanced calls to begin/end appearance transitions for QLRemotePreviewContentController

Your application must be using a navigation controller. If that's the case, navigation controller must be the one to handle interaction for the preview, not the view controller within it.

Replacing your return self inside of documentInteractionControllerViewControllerForPreview with self.navigationController should solve the problem. However, you need to safely unwrap navigationController. See the complete method below:

func documentInteractionControllerViewControllerForPreview(controller: UIDocumentInteractionController) -> UIViewController {
if let navigationController = self.navigationController {
return navigationController
} else {
return self
}
}

Cudos to @staxim for the Objective-C solution!

Unbalanced calls to begin/end appearance transitions for...- UIViewController containment

turns out it was a bug within iOS5. After recreating the code on a seperate project, it worked. So i traced the problem to the iOS5 Appearance Customization protocols, when i tried changing the font within UINavigationBar, it causes errors within MFMailComposeViewController and another modal view within iOS6.

I have filed a radar with Apple



Related Topics



Leave a reply



Submit