[英]pushViewController doesn't work after an Xcode 9 update
I use a xib not a storyBord.我使用的是xib而不是storyBord。 The problem is when i want to change windows on the application.
问题是当我想更改应用程序上的窗口时。 I can load the next window but i can't display it with pushViewController,i'm informing you that worked before updating Xcode.
我可以加载下一个窗口,但我无法使用 pushViewController 显示它,我通知您在更新 Xcode 之前可以正常工作。
Thanx for your responses感谢您的回复
Button click method :按钮点击方法:
`MesFic *vueMesFic=[[MesFic alloc] initWithNibName:@"MesFic" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:vueMesFic animated:YES];
[vueMesFic release];
vueMesFic=nil;`
my appDelegate.m我的 appDelegate.m
MyStyleSheet * myStyleSheetInstance = [[MyStyleSheet alloc] init];
[TTStyleSheet setGlobalStyleSheet:myStyleSheetInstance];
[myStyleSheetInstance release];
// Override point for customization after application launch.
//[self.window addSubview:[navigationController view]];
[self.window makeKeyAndVisible];
[window setRootViewController:navigationController];
return YES;
If you are using navigationController then, make sure that you have set navigationController as your root controller.如果您正在使用 navigationController,请确保您已将 navigationController 设置为您的根控制器。
MyStyleSheet * myStyleSheetInstance = [[MyStyleSheet alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:myStyleSheetInstance];
[window setRootViewController:navigationController];
In this case, you can use self.navigation for navigation在这种情况下,您可以使用 self.navigation 进行导航
[self.navigationController pushViewController:vueMesFic animated:YES];
If you are not willing to use UINavigation,如果你不愿意使用 UINavigation,
MyStyleSheet * myStyleSheetInstance = [[MyStyleSheet alloc] init];
[window setRootViewController:myStyleSheetInstance];
then use然后使用
[self presentViewController:viewController animated:YES completion:nil];
It may help you它可能会帮助你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.