Spring
Spring

Reputation: 11835

iPhone changing the rootviewcontroller dynamically?

I will use UINAvigationController in my app, but noticed that my rootview should be either a tableview or a uiview depending on content I received. as you know It comes with a tableview by default. how can I push my first view dynmacally here ?

Upvotes: 0

Views: 2049

Answers (1)

Ilanchezhian
Ilanchezhian

Reputation: 17478

U can do like this in application:didFinishLaunchingWith.... in app delegate. For this, u need to create the application with window based application template.

DetailViewController *detailView = [[DetailViewController alloc] initWithNibnam..];
UINavigationController *uiNavController = [[UINavigationController alloc] initWithRootViewController:detailView];
self.window.rootViewController = uiNavController;
[detailView release]; 
[uiNavController release];

Upvotes: 3

Related Questions