Regarding Adding Views

0 views
Skip to first unread message

sachin gupta

unread,
Dec 18, 2009, 6:44:24 AM12/18/09
to iphone-appd...@googlegroups.com
Hello All,

I have question regarding views.

I am NOT using UINavigationController or UITabBarController.

I have button which sends me to the other view.
Then on other view there is a button which sends me back to the previous view.

So in this case do I need to create the old view again?
Or is there other way around?

I hope I am able to convey my problem.
Thanks

marcio

unread,
Dec 18, 2009, 10:07:01 AM12/18/09
to iPhone Application Development Auditors
You mean you have 2 UIViewControllers. The first one calls the second
one via a button?

When you call the 2nd one, are you removing the first one from the
window and adding the 2nd one to the window?

I dont think you would need to re-create it, just add it back to the
window and for that you would need to alloc.init it after having
released it properly when you pressed the button on the first VC.

bluelobe

unread,
Dec 19, 2009, 12:59:21 PM12/19/09
to iPhone Application Development Auditors
If I were you, I'd use UINavigationController and just turn off the
navigation bar, so you'll just be using your buttons to go from one
view to the other, like...

at page1:

- (IBAction) page1_btn_clicked:(id)sender {

[self.navigationController setNavigationBarHidden:YES animated:NO];
[self.navigationController pushViewController:self.page2ViewController
animated:YES];

}

at page2 view controller:

- (IBAction)btn_clicked_so_popBack {
[self.navigationController popViewControllerAnimated:YES];

Reply all
Reply to author
Forward
0 new messages