Trev
Trev

Reputation: 25

popToRootViewControllerView

self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;

It looks like the above in the delegate is setting the initial view as the root view. Is that true? Or is it setting the current view each time? How dpi set the initial view as the root view?

Because when I'm on my 3rd view and want to pop back to initial view its not happening:

[self.navigationController popToRootViewControllerAnimated:YES];

Upvotes: 0

Views: 41

Answers (1)

msgambel
msgambel

Reputation: 7340

Are you using a UINavigationController? If so, you should have code in your AppDelegate that looks like:

[window addSubview:navigationController.view];
[window makeKeyAndVisible];

Make sure that you do have a UINavigationController hooked up, otherwise, you won't be able to use methods like:

[self.navigationController popToRootViewControllerAnimated:YES];

Hope that Helps!

Upvotes: 1

Related Questions