Note that there are some explanatory texts on larger screens.

plurals
  1. PONon-Existent View Controller getting viewDidAppear called
    primarykey
    data
    text
    <p>I have a navigationController that I reuse for my Splash screen. Whenever I log out, I reset the navigationController's viewControllers array to just the single Splash screen. However I'm getting some odd behavior.</p> <p>Steps:</p> <p>Splash comes up - modal display, navigationController with single Splash viewController as root Select "Sign In" - Sign In view pushes on to Nav Controller</p> <p>Enter info, submit, success, dismiss modal View</p> <p>Go through the app.... then Logout again</p> <p>Replace modal navigationController's viewControllers (currently Splash -> Sign In) with a newly made viewController (Splash).</p> <p>Present Modal ViewController</p> <p><em><strong></em> UNEXPECTED BEHAVIOR **</strong></p> <p>Original "Sign In" View Controller's viewDidAppear method gets called.</p> <p>Other than the "Sign In" view controller's viewDidAppear getting called, everything behaves like normal. The new Splash comes up, I can push a new Sign In on, no problem. Everything continues as normal.</p> <p>I have a NSNotificationCenter addObserver in my viewDidAppear, so this extra viewDidAppear getting called is throwing off behaviors in the app else where, which is why I need to figure out where this is coming from and fix it.</p> <p>Backtrace Paused at erroneous "viewDidAppear"</p> <pre><code>Thread 1, Queue : (null) 0 0x000f1881 in -[KeyboardViewController viewDidAppear:] at /Users/Me/App/Classes/KeyboardViewController.m:69 1 0x00d79fbf in -[UIViewController _setViewAppearState:isAnimating:] () 2 0x00d7a2d4 in -[UIViewController __viewDidAppear:] () 3 0x00d7b8c9 in __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke_0 () 4 0x00d7a730 in -[UIViewController _executeAfterAppearanceBlock] () 5 0x00cc35ea in _afterCACommitHandler () 6 0x01dfa9ce in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ () 7 0x01d91670 in __CFRunLoopDoObservers () 8 0x01d5d4f6 in __CFRunLoopRun () 9 0x01d5cdb4 in CFRunLoopRunSpecific () 10 0x01d5cccb in CFRunLoopRunInMode () 11 0x0261b879 in GSEventRunModal () 12 0x0261b93e in GSEventRun () 13 0x00cb2a9b in UIApplicationMain () 14 0x000028d9 in main () </code></pre> <p>If I popToRootViewController in the navigationController before dismissing it, this issue goes away. However, if I wait .5 seconds and dismiss once the navigationController is already dismissed, the issue persists. Ideally I don't want to popToRootViewController while it's dismissing...</p> <p>Then when I was calling popToRootViewController before dismissing, the viewDidDisappear method wasn't getting called... For now, I've got a hack in place that takes a snapshot of the current stack of viewControllers, replaces them, loads the view, then iterates over the stored stack of Controllers, undoing the code that runs in the viewDidAppear method (NSNotification stuff...)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload