ios - Set rootViewController of UINavigationController by method other than initWithRootViewController -
how set rootviewcontroller
of uinavigationcontroller
method other initwithrootviewcontroller
?
i want use initwithnavigationbarclass:toolbarclass:
deliver custom toolbar navigationcontroller, don't think can use initwithrootviewcontroller
.
you can solve calling setviewcontrollers
.
like this:
uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithnavigationbarclass:[mynavigationbar class] toolbarclass:[uitoolbar class]]; [navigationcontroller setviewcontrollers:@[yourrootviewcontroller] animated:no];