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

  • Home
  • SEARCH
  • 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 6791765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:53:09+00:00 2026-05-26T17:53:09+00:00

I’m trying to display data from a plist that is an array of dictionaries:

  • 0

I’m trying to display data from a plist that is an array of dictionaries:

<array>
    <dict>
        <key>title</key>
        <string>RATATOUILLE</string>
        <key>coverImage</key>
        <string>rat.png</string>
        <key>smallImage</key>
        <string>rat-small.png</string>
        <key>description</key>
        <string>Spray a pan with cooking spray. Brown the onion and the garlic (do not let garlic burn!). Add all the veggies and the bay leaf and simmer covered for 2 hours. Sprinkle on the breadcrumbs and cook another 5 minutes. Remove the bay leaf and serve.
5 servings, 0 POINTS each (if you eat the whole thing, count points for the bread crumbs)</string>
    </dict>

in the rootviewcontroller the data displays just fine in the cells. In the detailviewcontroller I’ve tried the same method and it doesn’t display anything. What am I doing wrong?
Here’s the code:

- (void)viewDidLoad {
    [super viewDidLoad];
    NSDictionary *details = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Testdata" ofType:@"plist"]];

    coverImageView.image = [UIImage imageNamed:[details objectForKey:@"coverImage"]];
    titleLabel.text = [details objectForKey:@"title"];
}

what I don’t understand is how it works actually. In the rootviewcontroller I have this method :

-(id)initWithCoder:(NSCoder *)aDecoder {

    if (self = [super initWithCoder:aDecoder]) {
        NSString *path = [[NSBundle mainBundle] pathForResource:@"TestData" ofType:@"plist"];
        arrayIndex = [[NSArray alloc] initWithContentsOfFile:path];

    }
    return self;
}

and the data is pulled from the “arrayIndex”. Isn’t the same for the detailviewcontroller?
……………….
Edit:
I figured it out, made a string in the tableviewcontroller:

NSString *selectedItem = [arrayIndex objectAtIndex:indexPath.row];
detailViewController.selectedItem = selectedItem;

and loaded data in the detailviewcontroller like this:

coverImageView.image = [UIImage imageNamed:[selectedItem valueForKey:@"coverImage"]];
    titleLabel.text = [selectedItem valueForKey:@"title"];
  • 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-05-26T17:53:10+00:00Added an answer on May 26, 2026 at 5:53 pm

    I think you miss the array part, you should load an array form the plist and then get the dictionary at proper index. Incidentally you’ve apparently already loaded the data in memory in the rootviewcontroller, so you could just pass it as a property to the detail view together with the index to be read.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has

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.