Since there release of new Xcode, there is no option for creating navigation based application. This simple post will show you how to do it programmatically.
Firstly, create a new project in Xcode selecting simple view application templete. Then in your AppDelegate.h file create a UINavigationController object
@property (strong, nonatomic) UINavigationController* navigationController;
Then in the AppDelegate.m file modify the method
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
navigationController =[[UINavigationController alloc] init];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
[navigationController pushViewController:self.viewController animated:NO];
self.window.rootViewController = navigationController;
[self.window makeKeyAndVisible];
return YES;
}
No comments:
Post a Comment