ios - Navigation Controller : What is below the topmost view controller in navigation controller on the window? -


what below topmost view controller in navigation controller on window? (is 'navigation controller' or 'the view controller below top view controller' in navigation stack?)

or

are view controllers present on phone window simultaneously 1 below other on navigation controller or stack maintains references them , loaded , unloaded push , pop operations called?

you trying mix understanding of views viewcontrollers, don't pay attention to.

are view controllers present on phone window simultaneously 1 below other

from rendering point of view, window hosts views on top of it, not view controllers. when navigation stack generated through push/pops, window host view of navigation controller it's root controller object.

navigation controller object comprise of uinavigationbar , content view host views of child controllers.

now comes question, how hierarchy of view's , view controller's maintained. uinavigationcontroller host single view @ time, if there multiple controller's on stack, top controller's view loaded in view hierarchy. view stack

window->navigationcontrollerview->topmostcontrollerview 

as view controller's hierarchy, maintained on stack , stays alive unless pop message sent navigation controller. can destroyed on receiving memory warnings. refer documentation other details

to illustrate this, have generated simple stack trace. if @ object 0x7a6cfd60, view of top controller mydocumentsvc (look @ bottom line) , present single subview of uiviewcontrollerwrapperview nothing content view of navigation controller.

(lldb) po [[self.navigationcontroller view] subviews] <__nsarraym 0x7bad3bf0>( <uinavigationtransitionview: 0x7bad3a10; frame = (0 0; 768 1024); clipstobounds = yes; autoresize = w+h; layer = <calayer: 0x7bad3bc0>>, <uinavigationbar: 0x7b960780; frame = (0 20; 768 44); opaque = no; autoresize = w; gesturerecognizers = <nsarray: 0x7a69ec40>; layer = <calayer: 0x7b960300>> )   (lldb) po [[[[self.navigationcontroller view] subviews] objectatindex:0] subviews] <__nsarraym 0x7baf59f0>( <uiviewcontrollerwrapperview: 0x7a6c2290; frame = (0 0; 768 1024); autoresize = w+h; layer = <calayer: 0x7a6c2360>> )   (lldb) po [[[[[[self.navigationcontroller view] subviews] objectatindex:0] subviews] objectatindex:0] subviews] <__nsarraym 0x7a6ec3f0>( <uiview: 0x7a6cfd60; frame = (0 0; 768 1024); autoresize = w+h; layer = <calayer: 0x7a6cfdd0>> )   (lldb) po [self.navigationcontroller viewcontrollers] <__nsarrayi 0x7a6e9c20>( <viewcontroller: 0x7b956820>, <mydocumentsvc: 0x7b96bc30> )   (lldb) po [[[self.navigationcontroller viewcontrollers] objectatindex:0] view] <uiview: 0x7a6b68c0; frame = (0 0; 768 1024); autoresize = w+h; layer = <calayer: 0x7a6b6930>>  (lldb) po [[[self.navigationcontroller viewcontrollers] objectatindex:1] view] <uiview: 0x7a6cfd60; frame = (0 0; 768 1024); autoresize = w+h; layer = <calayer: 0x7a6cfdd0>> 

Comments