View Full Version : App planning guidence needed
Nov 27, 2009, 08:20 AM
I am new to programming and want to begin to plan out a simple app. I have a question about how to best go about it. View Based, Navigation based etc.
The idea would best be described as a type of "magazine". Each "page" is unique in that it presents different information, images and buttons with different actions.
What is the best practice method for dealing with multiple unique views?
If I have 25 views that have unique content and functionality, do I create 25 unique classes with a view controller for each?
Nov 27, 2009, 09:55 AM
Well to create different view with different actions, etc. you only need one .xib file. Then you just drag and drop as many view as you want from the library. Then select the view and click "File->Write Class Files" to write the class files for the view. Inside the header file you can define whether it is a UIView, UIViewController, etc.
Nov 27, 2009, 10:34 AM
Thanks for your response. I really appreciate it. So are you saying that for 25 "pages" I need 25 separate classes with a controller for each one?
Nov 27, 2009, 11:12 AM
Yes, each UIViewController can only have one view. But you can have views without view controllers (buttons, text areas, etc...), so if you don't have a reason to use a UIViewController (for example if you don't need it's callbacks) don't use it. Just create the views and keep them on your MainManager object (something like that).
Nov 27, 2009, 11:36 AM
Thanks very much for the help. I thought that was the case. So for someone who would want to do...let's say an alphabet, they would need 26 classes and view controllers, one for each "page", and if the pages had flip sides, they would need a total of 52? It seems very unwieldy?
Nov 27, 2009, 11:44 AM
Well, it is and then again it isn't. If each view is similar, say they each share the same attributes such as a title and description and you just want to change those attributes, you would just make them IBOutlets and change them in the code (all in one view). However, if your views are extremely different the most common way is to create them each different view. Your welcome by the way :)
Nov 27, 2009, 01:06 PM
You've been very kind. I'm going to do some experimenting...
Nov 27, 2009, 01:06 PM
Hello, I am new to programming and want to begin to plan out a simple app. I have a question about how to best go about it.
Read the documentation. That is the best way. Are you new to programming for UIKit, or are you new to programming in general?
If you have programming experience, but are new to UIKit, make sure to read:
iPhone Human Interface Guidelines
iPhone Development Guide
iPhone OS Technology Overview
iPhone Application Programming Guide
View Controller Programing Guide for iPhone OS
If you don't have Mac programming experience, you also want to read:
The Objective-C Programming Language
Cocoa Fundamentals Guide
Cocoa Design Patterns
If you don't have any programming experience, find a good book on the C Programming Language and read that.
That documentation should give you plenty of answers about how to design your application. If you are coding twenty different view controller classes for twenty different views, you might not be working as efficiently as you should.
Nov 27, 2009, 02:59 PM
Thanks for taking the time to answer. I'm coming from Flash.
Reading the books and doing the tutorials. And asking basic questions on the forums...
I do appreciate the advice.