ios - Two UINavigationItems? -


could explain why there 2 navigationitems? when log below:

nslog(@"%@", self.navigationitem); nslog(@"%@", self.navigationcontroller.navigationitem); 

i 2 different instances of uinavigationitem:

<uinavigationitem: 0x7f85b06f5a20> <uinavigationitem: 0x7f85b06ab640> 

i have created uinavigationcontroller programmatically once.

all uiviewcontrollers have property navigationitem. therefore, because uinavigationcontroller subclass of uiviewcontroller, has property.

self.navigationitem 1 presented when controller pushed. documentation navigationitem, it's clear property

this unique instance of uinavigationitem created represent view controller when pushed onto navigation controller.

self.navigationcontroller.navigationitem would item displayed if apple allowed uinavigationcontrollers nested. however, since isn't allowed, it's best forget it.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -