View控制器最初是从appdelegate加载的。后来,通过隐藏和取消隐藏动画来管理它。在该视图控制器中,prepareForSegue并不要求嵌入容器视图。
在AppDelegate
+ (AppDelegate *) appDelegate {
return [[UIApplication sharedApplication] delegate];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.videoViewController = [[PlayerViewController alloc] init];
return YES;
}
要显示视图控制器,请执行以下操作:
[UIApplication sharedApplication];
AppDelegate *appDelegate=(AppDelegate *)[[UIApplication sharedApplication] delegate];
[[appDelegate videoViewController]show];
显示后,我试图从Viewcontroller触发embed segue,但它甚至没有触发prepareforsegue。