Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:29:27+00:00 2026-06-05T18:29:27+00:00

I’m making my first iphone application and it’s a wine chart application. It’s with

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:29:28+00:00Added an answer on June 5, 2026 at 6:29 pm

    You should start by reading about how to use the model-view-controller paradigm in Objective-C. This will explain how to separate your data from views of that data. Once you understand that, you’ll be in a better position to understand the rest of this.

    I would suggest making one change to your plist file. Rather than having the top level be a dictionary where each wine name is a key, and the value for each key is a dictionary containing information about the wine, I would make the top level be an array of dictionaries. Each wine would be one element in the array, and would be a dictionary containing all the information you currently have plus the wine’s name. This will more closely correspond to what your data model will look like. Something like this:

    <array>
        <dict>
            <key>Name</key>
            <string>J. P. Chenet Merlot</string>
            <key>Image</key>
            <string>JPChenet.png</string>
            ... the rest of the keys and values for this wine ...
        </dict>
    
        <dict>
            <key>Name</key>
            <string>Campo Viejo Crianza</string>
            ... the rest of the keys ...
        </dict>
    </array>
    

    Each wine object would contain an instance variable for each element in the dictionary. (So one for image, one for name, one for district, etc.) Something like this:

    @class WineObject : NSObject { 
        NSString* name;
        NSString* imagePath;
        NSString* district;
        // ... etc.
    };
    

    Your model could just be an NSArray of WineObjects. You could read the objects out of the plist using the method I mentioned in your other question. It would look something like this:

    NSMutableArray* wineModel = [[NSMutableArray alloc] init];
    NSArray* wines = [NSArray arrayWithContentsOfURL:<url of the plist file>];
    NSEnumerator* wineEnum = [wine objectEnumerator];
    NSDictionary* nextWine = nil;
    while ((nextWine = [wineEnum nextObject]) != nil)
    {
        // Get the wine data from the dictionary
        WineObject* newWine = [WineObject wineWithDictionary:nextWine];
    
        // Add the next wine to our model
        [wineModel addObject:newWine];
    }
    

    Your WineObject class would then have a class initializer something like this:

    + (id)wineWithDictionary:(NSDictionary*)wineDict
    {
        name = [wineDict objectForKey:@"Name"];
        district = [wineDict objectForKey:@"District"];
        imagePath = [wineDict objectForKey:@"Image"];
        // ... extract the rest of the values from the dictionary ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.