1
我需要使用MGSplitViewController,因爲它能夠在縱向模式下顯示主視圖控制器。但是,在顯示我的分割視圖之前,我需要顯示一個登錄屏幕。不幸的是,我無法在啓動時全屏彈出視圖控制器,因爲我調用了其他一些方法!下面是我的應用程序委託和詳細視圖控制器代碼。請注意,選擇器方法阻止我打開模式!MGSplitViewController不是作爲根
AppDelegate.h使用MGSplitViewControllerAppDelegate.h
// RandomStringAppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch.
// Set the split view controller as the window's root view controller and display.
//self.window.rootViewController = self.splitViewController;
// Add the split view controller's view to the window and display.
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setObject:@"YES" forKey:@"FirstRun"];
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
[rootViewController performSelector:@selector(selectFirstRow) withObject:nil afterDelay:0];
[splitViewController performSelector:@selector(toggleMasterView:) withObject:nil afterDelay:0];
[detailViewController performSelector:@selector(configureView) withObject:nil afterDelay:0];
//[self.window makeKeyAndVisible];
return YES;
}
一切是標準建造! 不幸的是,我不能在這裏彈出模式,因爲它在我身上崩潰!