janusfidel
janusfidel

Reputation: 8106

navigationController push same view controller (self)

I have a view controller (HomeViewController) and push another view controller (UserProfileViewController) in my UserProfileViewController, I want to push another instance of UserProfileViewController. How can I do that when I'm in UserProfileViewController?

Thanks!

Upvotes: 0

Views: 876

Answers (1)

Bani Uppal
Bani Uppal

Reputation: 866

You can just create a new instance of that view controller and push it. like:

UserProfileViewController *x = [[UserProfileViewController alloc] init];
[yourNavController pushViewController x];
[x release];

This new view controller will have a different address in memory, and will be entirely different from the current view controller.

Upvotes: 2

Related Questions