简体   繁体   中英

pushViewController doesn't work after an Xcode 9 update

I use a xib not a 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.

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

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.

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.navigationController pushViewController:vueMesFic animated:YES];

If you are not willing to use UINavigation,

 MyStyleSheet * myStyleSheetInstance = [[MyStyleSheet alloc] init];
[window setRootViewController:myStyleSheetInstance];

then use

[self presentViewController:viewController animated:YES completion:nil];

It may help you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM