Adding another view to a view-based application

I am developing an iphone application that stores some data in a database. This works great. But now I have a problem where I want to show data. Because in order to display the data, I need to create another view. But I am facing a problem when I try to add another view. Is it possible to have multiple views in a view based application because my application is a view based application? If so, how do you do it? Please help me

Thanks in advance Joy

+2


a source to share


2 answers


Yes. Basically you create your new view [alloc / init] and then render it.

Usually you show 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 is to use xcode to create a navigation based app and see how to build it).



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

[self presetModalViewController:newViewContoller animated:YES];

Finally, you can do a front / flipside view. Take a look at the utility app template in xcode.

+5


a source


Yes, several types can be used. You can manually add them to the window using addSubView

.

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



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

0


a source







All Articles