ios - xCode Navigation Back Button not popping detailview -
ios - xCode Navigation Back Button not popping detailview -
whenever press on 'go back' button on final detail view, wont go table view.
i have storyboard setup this:
uitabviewcontroller -> uinavigationcontroller -> uitableview -> uinavigationcontroller -> uiview (the detailview).
when run programme see button, clicking nothing.
here code detailviewcontroller.m:
- (void)viewdidload { [super viewdidload]; uibarbuttonitem *backbtn = [[uibarbuttonitem alloc] initwithtitle:@"go back" style:uibarbuttonitemstyleplain target:self action:@selector(gobackbtn)]; [self.navigationitem setleftbarbuttonitem:backbtn]; [self configureview]; } - (void)gobackbtn { [self.navigationcontroller popviewcontrolleranimated:yes]; }
as if [self.navigationcontroller popviewcontrolleranimated:yes];
nothing.
i'm out of ideas. why backbutton not 'pop' detailview?
your detail view controller root view controller of navigation controller. 'popping' nothing. need instead dismiss navigation controller. technically, should utilize delegate tell tableviewcontroller
dismiss it, think
[self.navigationcontroller dismissviewcontrolleranimated:yes completion:null];
from within gobackbutton
method of detail view controller trick.
ios objective-c iphone uitableview xcode6
Comments
Post a Comment