how to create multiple pages in Xcode iphone apps - iphone

i am starting my experience with iphone sdk. and i have a question, which is i am trying to create two pages to the app but i don't know how to link them or design them. like when i start the Xcode i find one page named View to design in it, i want to make that page a welcoming page then the user choose one of the three choices he see in that page. Once he clicked on one of them the program take him to the next page or the page he chose.
thank you

The standard approach on iPhone is a drill-down. Place a UINavigationController in your NIB, make the root-level view your welcome page. Then navigate to dependent views by invoking pushViewController on that navigation controller.
This is a very high-level description; you'd have to fill a lot of blanks. If you create a new project and specify a "navigation-based application", you'll get quite a bit of boilerplate code for this approach.

You really need a good book, I recommend Beginning iPhone 3 Development by Apress.

Take a look at using UIViewController's
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
method. You can display your initial view, and when the user presses one of the buttons, display the intended view over top. If you build a new project, and choose "Utility Application" you will get some sample code for how this works.

Related

In Xcode 4 which is the better app Window based or view based?

I am very new to iOS development. I am going to start a new project which is mostly related to to the database. Can you suggest what should I start from Window or view based app?
A view-based app only have one view, and includes a nib. However, window based app don't include a nib or a view, it's for add your own view.
I would chose view-based
1.There is no such difference in both
In View Based app you will get a default view controller in window.
In Window Based app you will not get anything by default already added in window, you have to add your own view.
They're used for different things. Neither is better than the other.
If you're a total rookie, I'd go with View based. It comes wired up with more stuff for you by default, and lets you work on your app's functionality rather than the details of getting stuff on the screen. It also limits you in ways that Window based doesn't, but for your level that's probably a good thing.
Anyway you have to make ViewController if you make project using window based.
Make your project using window based and View based. and compare both. So you can find what is different.
and iOS can have many view on only one window.

What is the best way to manage 9-15 view from a main menu in an iOS app?

In my iPhone app, I must have around 9-15 different views, all available from a main menu. I started yesterday with a simple tab bar controllers, but they are only ideal with 6-7 views. Which controller can I use? Is there a nice one for my needs?
Edit: I am talking about around 9-15 menu-points for my application.
Each point is a single, categorizable function. I though about something like the Facebook app, where the app shows 2 menu-pages (slideable) and 9 icons on each page, each with another view / function in it.
look for cocoacontrols.com . i think you will find your need there .....
I think the component you are looking for(the same used in facebook app) is in the three20 library. Its called Launcher. It's like having iphone springboard inside the app. I'd go with that.
Can your views be split into categories? If so, I would suggest using the tab bar tabs as categories, and then using a table view as a menu in each tab.
You could also try using a page control, but 9-15 views seems like they would be obnoxious to navigate with a page control.
I understand that you need to have access to those "views" all the time. You can do what an iphone CNN app does. It uses horizontal scroll, where it has lot's of "views".
This is propably the most challenging part of writing an app for mobile phones. At least i find it not that easy to find the perfect user interface. Espcially if you have so much content and navigation to show.
I think the best way to solve this problem is to write your own navigation. If you want to use something similar like the facebook app - this is not so hard.
Take a UIScrollView in combination with the UIPagingControl. Create a new View for your buttons or whatever you want your user to see and put it in the scroll view. Enable paging for the UIScrollVIew and your almost done. Maybe it's not the easiest way - but in the end it's the most flexible way. You can decide what you want to show and you dont have to be dependent on what some other developer wrote.
Just a thought :)
// Edit: Just read in another question about appLauncher. This might be such a control you are looking for.
https://github.com/rigoneri/myLauncher

Make a home view for application

Hi guys i am very eager to know that how we can make a view like in this application having different icons calling different viewcontrollers and edit button to add shorcuts to tab bar at the bottom. Any tutorial link will be appreciated .
Thats a really long view, why would you want that? Unless you are putting that into a UIScrollView..
Check Three20 Launcher, it may suit your needs, and it is widely used in many apps.
Here is a tutorial for using the UITabBarController: http://21gingerman.wordpress.com/2009/04/06/tutorial-and-sample-code-for-iphone-app-with-tab-bar-and-nav-bar/
Which seems like what you're asking for.
It will allow you to have a "More" button which gives you the view you're looking for.
Otherwise, seems like if you need more control, what you're looking for could be accomplished fairly simply with a UIScrollView and some UIImageViews. There are two great videos on using UIScrollView in the developer videos section of the apple dev site. (They open up in iTunes) http://developer.apple.com/videos/

iPhone page one is written.. any simple "how to" to make a button go to another page?

iPhone page one is written.. as view based app, any simple "how to" to make a new page, and how to get a button to take me there?
Also looking for a "how to" make an info button/page to flip..
Anyone? Thx a lot :-)
If you're interested in flip behavior, take a look at the "Utility Application" template in Xcode.
This is a very broad question as there are many ways to show another view. I suggest you start with the ViewController Programming Guide for iPhone OS in order to narrow your question down to the type of view and transition you want to implement.
If you want to play with navigation between views, I would recommend starting with a navigation-based iPhone project and trying some code like in this answer to How do I reset a UINavigationController?

How do I create a simple two-screen iPhone app?

I've gone through most of the example code and I still need some help. I want to make an uber-simple app: show one screen at startup with a label and a button. click the button and we slide over to another screen (I suppose these are called views) which has another label and the "back" button in the top menu bar. I just want to click back and forth between the two screens.
How do I do this?
Take a look at the NavBar sample on Apple's Developer website. http://developer.apple.com/iphone/library/samplecode/NavBar/index.html
You'll need to use a UINavigationController to accomplish the "slide"/"back button" behavior you're talking about. It is as simple as you might think, as long as the app is setup correctly. Essentially, UINavigationControllers allow you to push and pop instances of UIViewController or subclasses thereof, and take care of the animation and view history tracking for you.
The best way to get started, by far, is just open XCode, choose "New Project", and start with the "Navigation-Based Application." Dig around that project for a while and I think you'll start to see clearly what needs to be done.
You can checkout how to get started with that using this tutorial: at wattz.net