iphone - UITabbarController + UINavigationController creating issue for push and pop -
in iphone application using uitabbarcontroller + uinavigationcontroller, created in appdelegate.
my issue follows:
on screen- have tableview. when 1 selects cell pushing controller screen-b. without poping if select tab tabbar, view gets refreshed navigationbar not getting refreshed. displays navigationbar of screen-bscreen-b.
spent hours on searching solution issue on google failed.
used below code nothing seems solve issue:
- (void)tabbarcontroller:(uitabbarcontroller *)tabbarcontroller didselectviewcontroller:(uiviewcontroller *)viewcontroller { if ([viewcontroller iskindofclass:[uinavigationcontroller class]]) { [viewcontroller.navigationcontroller poptorootviewcontrolleranimated:no]; } } any appriciated.
try in appdelegate
uinavigationcontroller *screen1=[[uinavigationcontroller alloc] initwithrootviewcontroller:controller1]; uinavigationcontroller *bscreen=[[uinavigationcontroller alloc] initwithrootviewcontroller:controller2]; nsarray *tabbararray=[[nsarray alloc] initwithobjects: screen1,bscreen,nil]; self.tabcontrollerobj.viewcontrollers=allviewcontrollers; and make tabbar root viewcontroller of window
Comments
Post a Comment