Senthil
Senthil

Reputation: 510

Inconsistent behavior in viewDidAppear Objective C

[ViewController] Calling -viewDidAppear: directly on a view controller is not supported, and may result in out-of-order callbacks and other inconsistent behavior. Use the -beginAppearanceTransition:animated: and -endAppearanceTransition APIs on UIViewController to manually drive appearance callbacks instead. Make a symbolic breakpoint at UIViewControllerAlertForAppearanceCallbackMisuse to catch this in the debugger

May i know the exact reason causing this issue.

Thanks in advance

Upvotes: 1

Views: 830

Answers (2)

CTABUYO
CTABUYO

Reputation: 712

You can't call the viewDidAppear: method by yourself.

Instead put whatever code you have inside viewDidAppear: and relocate to a new method which you define yourself. Then you can call that method just as you are calling viewDidAppear: now :)

Upvotes: 0

matt
matt

Reputation: 534885

It seems, from the error message, that you are calling viewDidAppear:. Never do that (except to call super from within your implementation). It is an event method to be called by the runtime, not by you. That is what the error message is telling you.

If for some reason you don't know how to find your code where you are making this mistake, the error method also tells you how to set a breakpoint to find it when it happens.

Upvotes: 0

Related Questions