iphone - present a UIviewcontroller programmatically from UINavigationController with Storyboard -
my question: how can switch between viewcontrollers 1 rootnavigationcontroller
in code, while maintaining customization set in storyboard , data load in viewcontrollers?
currently implementing remenu, provides simple dropdown tableview change views with. when 1 of cells pressed in dropdown, want switch view. example, if press "home", want go masterviewcontroller
method switch views called within rootnavigationcontroller.m
, , looks following:
remenuitem *homeitem = [[remenuitem alloc] initwithtitle:@"home" subtitle:@"return home screen" image:[uiimage imagenamed:@"icon_home"] highlightedimage:nil action:^(remenuitem *item) { uistoryboard *sb = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; uinavigationcontroller *vc = [sb instantiateviewcontrollerwithidentifier:@"mynewtableview"]; // vc.modaltransitionstyle = uimodaltransitionstylecrossdissolve; [self presentviewcontroller:vc animated:no completion:nil]; }];
clearly, however, wrong implementation, because ignores ui customization made in storyboard, datacontroller invoke in masterviewcontroller.m
on matter appreciated!
Comments
Post a Comment