Ruan
Ruan

Reputation: 35

UINavigation Controll

So I have made a homePage UIViewController and i wish this to be my "main view"

So in my app delegates...

HomePage *homepage = [[HomePage alloc]initWithNibName:nil bundle:nil];
UINavigationController *navigator = [[UINavigationController alloc] initWithRootViewController:homepage];

navigator.navigationBar.hidden = YES;

[self.window addSubview:navigator.view];
[self.window makeKeyAndVisible];

I added this to a navigationController in my stroryboard (i think this could be part of the problem)

THE Problem

My homepage has buttons and a smaller sliding view... these things do not work at all... they just exists sort of as a image/mast

When i started the project i had a UIViewController in the storyboard which i "used" to create this homepage but did not do anything on it except added a image which i do now programatically anyway.

I am now trying to remove it without breaking the whole project. I also tested my homePage and the "viewDidLoad" was called.

Thanks for the help

Upvotes: 0

Views: 42

Answers (1)

Ganapathy
Ganapathy

Reputation: 4614

Try like this. Replace this line

[self.window addSubview:navigator.view];

with

self.window.rootViewController = navigator;

Upvotes: 1

Related Questions