ToolBar back button is not working

六眼飞鱼酱① 提交于 2020-01-07 04:54:30

问题


Iam doing one project using storyboard ,in one viewcontroller i have a button.When i clicked that it will move to next viewcontroller but its a separate xib file. Now i tried to add aback button to that xib file So i can move back to my storyboard but its not working form me ?

I tried following code for moving from xib to storyboard viewcontroller

viewcontrollerOne *list= [self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
[self presentModalViewController:list animated:YES];

please let me know the reason why its not working?


回答1:


you can try changing your project to UINavigationController and then in the storyboard you can link the views




回答2:


This code will work when you want to move from an xib to a viewcontroller in Storyboard,Its working for me.

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"];
[self.navigationController pushViewController:vc animated:YES];


来源:https://stackoverflow.com/questions/15847325/toolbar-back-button-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!