views:

129

answers:

3

Hi, I'm developing an iphone apllication that stores some data into a database. That is working fine. But now i have a problem when i want to show the data. Because to show the data i need to design another view. But i'm facing problem when i try to add another view.Is it possible to have multiple view in a view-based application,cause my application is a view-based application? If yes then how to do that? Please help me

Thanks in advance Joy

A: 

Yes it is possible to use multiple views. You can manually add them to the window by using addSubView.

You can also use a view controller like a UINavigationController or a UITabBarController.

It depends on how you want to display the views and how the user can switch between them.

Rengers
+4  A: 

yes. In principle you create your new view [alloc/ init], then display it.

Normally you would display it by pushing it onto the navigation controller stack.

[self.navigationController pushViewController:newViewController animated:YES];

If you don't have a navigation controller, you either need to create one (your best bet might be to use xcode to make a navigation based application and take a look at how its put together).

If you just want to simply display a second view controller, then you can display that as a modal view controller: alloc/init your second view controller then display it with

[self presetModalViewController:newViewContoller animated:YES];

Finally you could do a front view/ flipside view. Take a look at the utility application template in xcode.

Andiih
A: 

A sample code might help. thanks

Jeno