在我的子类中,NSObject
我想调用类似
[[self navController] presentModalViewController:myView animated:YES];
但是我的尝试都没有成功。如果我不在的子类中,如何调用模态视图UIViewController
?
解决方案:
#import "myProjectNameAppDelegate.h"
// ...
MyViewController *myView = [[MyViewController alloc] init];
myProjectNameAppDelegate *appDelegate = (myProjectNameAppDelegate *)[[UIApplication sharedApplication] delegate];
[[appDelegate navController] presentModalViewController:myView animated:YES];