I'm making my first iphone application and it's a wine chart application. It's with storyboard in xcode 4.2. It's based on a tab bar with 4 tabs: info, wine chart, search, favourites. I'm making the wine chart at the moment, In this tab I've put a TableView with a prototype cell and I want to fill this cell with name, district and image of the wines. So far I've done this:
1: Linked the second tab to a navigation controller
2: Linked the navigation controller to the TableView (WinesViewController)
3: Created the WinesViewController.h/.m class
4: Added a prototype cell with identifier: wineCell and title & subtitle labels with text: name & district.
5: Made a folder with all the images of the bottles WineName.png
6: Created a plist: Wine.plist with 1 dictionary for each wine, dictionary key = wine name. The dictionaries contains 19 strings with keys "Name", "District" "Image", "Acid level" etc.
This is the plist:
http://www.flickr.com/photos/80427098@N07/7372450200/in/photostream
That's all I've done so far, and now I want to fill the cell labels in the tableview with the strings in the plist, sorted alphabetically in sections. I'm new to this so I dont know which codes to use and where to put them. Can someone help me understand more of how to populate a tableview with information from the plist?
I've been told that I shouldn't put the code directly in the WinesViewController.h/.m. So then I've been told that I can create a subclass of NSObject (let's call it WineObject.h/.m), put some NSDictionary / NSEnumerator codes in here, and then somehow link this to the WinesViewController prototype cell. But I really don't know how! I'm not that experienced yet! I really hope someone can give me help with the codes, where to put them and how to link it all up. That it would be fantastic. I'm starting to understand X-Code and Objective C coding a little bit now (finally!) but this is to advanced yet, and some help now that I'm stuck would give me a lot to work with! Directions to helpful tutorials, sample projects etc is also appreciated.
Let me know if there is something more you need to know in order to answer my question! I haven't written a single line of code in the WinesViewController or WineObject so I really need the whole explanation..
Later I'll use the information from the same plist in a DetailViewController (a fullscreen view with info on the wines) thats why there's so many strings in the plist when I'm only using 3 values in the tableview cells. The search function will also be made on the data from this plist. Thank you for all useful help!