objective c - How to pop to root view controller on custom tab bar button clicked iOS -
i showing custom tab bar using tab bar controller.
and creating separate navigationcontroller view controllers.
first *firstviewcontroller = [[first alloc]init]; uinavigationcontroller *firstnavcontroller = [[uinavigationcontroller alloc]initwithrootviewcontroller:firstviewcontroller]; second *secondviewcontroller = [[second alloc]init]; uinavigationcontroller *secondnavcontroller = [[uinavigationcontroller alloc]initwithrootviewcontroller:secondviewcontroller]; third *thirdviewcontroller = [[third alloc]init]; uinavigationcontroller *thirdnavcontroller = [[uinavigationcontroller alloc]initwithrootviewcontroller:thirdviewcontroller]; tabbar.viewcontrollers = [[nsarray alloc] initwithobjects:firstnavcontroller, secondnavcontroller, thirdnavcontroller, nil]; tabbar.delegate=self; tabbar.selectedindex=0;
but when trying pop root on tab click, 3rd navigation controller accessible.
so working 3rd tab, first , second not working.
if you're loading view controller on top of tabbarcontroller
how dismiss loaded view controller.
[self.presentingviewcontroller dismissviewcontrolleranimated:self completion:nil];
Comments
Post a Comment