views:

109

answers:

4

Hi there,

I'm trying to get started with an iPhone application, I had a look around at other questions but i'm still sorta stuck so hopefully someone can help...

First thing is I'm totally confused with the whole view concept, I'm more used to visual studio so I'm going to use the term 'form' to describe what I have in my head.

I want to achieve a home screen in an application with say 9 icons (much like the iphone home screen) which each lead to a different 'form'. Each form may have a different function so say one might be a simple calculator, one might play a video etc.

How do I do this, its destroying my soul trying to do something so simple... If you guys even have any links to get me on the right track it would be greatly appreciated

A: 

I suggest you take a look at the Stanford iPhone Programming Course. If you don't have the time to look through it all, I reccommend at least Lectures 5 and 6 about Views and ViewControllers. The slides are quite instructive and they come with video presentations that should help you get on your way in about an hour.

luvieere
A: 

thanks

going from visual studio to xcode is making me feel very stupid

mmark
on stack overflow please don't post a new answer when you really just wanted to comment on luvieere's answer
philfreo
A: 

Apple's samples are a great place to start. There are some simple ones that can show you how views and view controllers work.

Also, in Xcode, when you create a new iPhone app template, that template usually has enough code to display a view, and sometimes a flip-side view or more. Sometimes, you should stop reading, and do.

mahboudz
A: 

I had the same weird learning curve as you, as things don't initially seem to make sense but they do - and once you've got your head round them they make perfect sense trust me!

Your 'forms' are viewControllers in this M-V-C land, they control all the 'view' (which are controls or any object which can be seen) within them. Normally they are loaded from a Nib (design from the interface builder), but don't have to be.

The way I would go about your problem is to use a navigationController as the base to handle all of your view controllers.

A navigation controller needs a rootviewcontroller to start so this will be your desktop Viewcontroller. I'm not sure how you are planning to populate this but all the icons will need to be stored in some kind of array. I suggest you use a simple UIButton. When then button is pressed you then alloc and init and push the required view controller.

Chris Beeson