Created
June 25, 2015 20:17
-
-
Save aleclaws/220b10793803aaa0c3c2 to your computer and use it in GitHub Desktop.
Can't Push Nav Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// fhwei | |
// | |
// | |
#import "AppDelegate.h" | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
UIViewController * vc = [[UIViewController alloc] init]; | |
vc.view.backgroundColor = [UIColor greenColor]; | |
UINavigationController * nav = [[UINavigationController alloc ] initWithRootViewController:vc]; | |
UINavigationController * mainNav = [[UINavigationController alloc] init]; | |
[mainNav pushViewController:nav animated:NO]; | |
//[mainNav setViewControllers:@[nav]]; | |
[self.window setRootViewController:mainNav]; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} | |
- (UIWindow *)window | |
{ | |
if(_window == nil) | |
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
return _window; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment