ios - Adding UINavigationController to root UIViewController using addChildViewController -


what want have root view controller manages base view of application , add uinavigationviewcontroller (with own view controller stack) view controller using ios 5+ containment api addchildviewcontroller().

edit: purpose of base view controller control dynamic view consistent background across application. there animations involved actual background view needs stay same across every view.

my question whether best practice , apple-approved way accomplish such design? have been reading conflicting advice in research , want make sure app not rejected.

here code appdelegate, shows trying do:

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {        baseviewcontroller * base = [[baseviewcontroller alloc] init];     playerviewcontroller * player = [[playerviewcontroller alloc] init];    uinavigationcontroller * nav = [[uinavigationcontroller alloc] initwithrootviewcontroller:player];    [nav setnavigationbarhidden:yes];     [base addchildviewcontroller:nav];    [base.view addsubview:nav.view];     [self.window setrootviewcontroller:base];    [self.window makekeyandvisible];     return yes; } 

thanks help.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -