ios - Set UINavigationItem title before viewWillAppear -
this point: i'm writing app "builds itself" reading configuration file. need create uitabbarcontroller contains several uinavigationcontrollers respective rootviewcontroller. since app doesn't know viewcontroller titles, need programmatically set them (from appdelegate) before viewwillappear: method fired.
if set title in viewwillappear method, first v.c. in tabbarviewcontroller show name in tabbar.
what's proper way this?
based on many assumptions trying achieve, think doing in application:didfinishlaunchingwithoptions: method of appdelegate should work:
uitabbarcontroller *cont = [[uitabbarcontroller alloc] init]; (int i=0; i<controllers_count; i++) { uinavigationcontroller *navcont = [[uinavigationcontroller alloc] init]; navcont.title = title_here; [cont addchildviewcontroller:navcont]; } [self.window setrootviewcontroller:cont];
Comments
Post a Comment