iphone - popToViewController can't switch between views -
i have function in ibaction button:
i start off table button, when button pressed takes place:
tabbarcontroller *v = [[tabbarcontroller alloc] initwithnibname:@"tabbarcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller: v animated:yes]; [v release];
on second view there button when pressed this:
nsarray *array = [self.navigationcontroller viewcontrollers]; [self.navigationcontroller poptoviewcontroller:[array objectatindex:1] animated:yes];
this causes app crash, , @ index 0 nothing. because second page not uitable first?
i want able move uitable view uiview , forth, should use addsubview
instead? need first view have navbar second shouldn't.
i think problem [array objectatindex:1]
current viewcontroller, popping current view controller might reason of crash (did not try though)
so why don't do:
[self.navigationcontroller popviewcontrolleranimated:yes];
Comments
Post a Comment