简体   繁体   中英

presenting a modal view controller

I have this same piece of code in two different parts of my app. In one section it is executed perfectly, and in the other it is completely ignored. I've put in a breakpoint and watched the program go through each line of this code without loading the next xib/class it is supposed to.

Here is the code:

UIViewController *nextController = [[ClassNameViewController alloc] initWithNibName:@"MatchingView" bundle:nil];

[nextController performSelector:@selector(setDelegate:) withObject:self];

[self presentModalViewController:nextController  animated:YES];

Any ideas why this might be getting ignored and not presenting my viewController?

尝试使用..

[self.navigationController presentModalViewController:nextController  animated:YES];

我在viewDidLoad中有此代码,并将其移动到viewDidAppear使其工作。

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