I have a navigation controller. One of the views adds custom subviews in its viewDidAppear:
. I notice that the first time I navigate to an instance of this view controller after launching the app, viewDidAppear:
invokes twice. If I pop this view off the stack and navigate to it again, viewDidAppear:
invokes only once per appearance. All subsequent appearances invoke viewDidAppear:
once.
The problem for me is that the first time I get to this view I end up with twice the number of subviews. I work around this problem by introducing a flag variable or some such, but I'd like to understand what is happening and how come I get two invocations in these circumstances.