views:

123

answers:

4

Hey,

I've been working on a Cook Book App but each view ( or recipie page) takes about 45 minutes to complete so as you can imagine its taking forever.

The problem is that I have to manually:

  1. Set up a gradient image for the back ground (Somtimes I have to add a few image backgrounds to fit the view as I often use a scroll view, not sure how this could be automated?)

  2. Put an image behind the titles "Recipe name" , "Time needed" and an image to go behind the recipie instructions ( again I might need a few of these depending on how long the description is.

  3. Creating view controllers for main sections such as "Breakfast" and "Lunch" and then I need to manually create view controllers to go in these sections.

Theres got to be a way to set up a template for this?

Thanks for reading all of this.

A: 

The application I worked on was a little simpler, since it only consisted of about five nibs, but I found it very helpful to create a ViewController-base-class, which took care of things like setting the background, handling some touch events etc ..., that were common to ll the Views.

gammelgul
Thanks for that, is there any chance you could point me in the direction of a tutorial that covers this?
Dave
+4  A: 

Are you creating a different view for EACH recipe? if so that sounds like a lot of work. I would utilize a database, a .plist, or some kind of data source to keep the recipe data. Then I would create template views for the recipes and load the data into each view.

I'm not sure I understand your struggle so I might be stating the obvious.

Ed Wist
I am creating different views for each recipie ands its really taking forever like you say. Could you please explain more on your idea? As it sounds perfect.
Dave
+1. @Dave this is how all such iPhone apps are generally made. Your recipe screen (aka detail view) is essentially a "template" whose view controller gets pre-loaded with the relevant info (recipe name, ingredients, etc.) before it gets displayed.
Shaggy Frog
Is there somewhere you could recommend where I could learn more about how to implement such a setup?
Dave
+1  A: 

You should create you app in the model-view-controller way. This is the way almost every iPhone application is made. You can read about it in almost all getting started guides.

This way of creating your app would allow you to have a template for recipes, that you could load into an array. The array would be displayed in a UINavigationController, that would create a UITableView, with your array. When the user taps on an item, another view would be loaded with the data of the recipe.

In this way you would only need your Recipe class, your UINavigationController class, and your RecipeView class.

Sorig
Thatsounds great , could you recommend a particular guide that covers this?
Dave
you can read about it in apples documentation. link: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html#//apple_ref/doc/uid/TP40002974-CH6-SW1There's also some cool video lessons on iphone programming on iTunes U: http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.3124430053.03124430055
Sorig
Thanks for your replies, I've having problems locating anything specific could you recommend any tutorial in particular that covers these 'templates'?
Dave
The video lessons in iTunes u, are really cool. You should watch them from the beginning. There's also a set of assignments that you can make as you go through the lessons.
Sorig
A: 

Thanks guys for all this great info, I now understand the process.

The problem is im not sure how to implement this from a coding aspect, is there a good tutorial I could read on this?

Dave