Skip to content

Instantly share code, notes, and snippets.

@aleclaws
Created June 25, 2015 20:17
Show Gist options
  • Save aleclaws/220b10793803aaa0c3c2 to your computer and use it in GitHub Desktop.
Save aleclaws/220b10793803aaa0c3c2 to your computer and use it in GitHub Desktop.
Can't Push Nav Controller
//
// 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