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 6473229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:26:28+00:00 2026-05-25T06:26:28+00:00

I am attempting to read the plist dictionary below into cells of a UITableView.

  • 0

I am attempting to read the plist dictionary below into cells of a UITableView. I want to create a subview for each of the strings contained in the array denoted by the ArrayKey like:

Row1: | myString1 |
Row2: | myString2 || myString3 |

I’ve used fast enumeration to read the dictionary, but I can only successfully read the first string in each array:

    CGFloat constant = 0;

    for (NSArray key in [dictionary objectForKey:@"ArrayKey"]) {


        UILabel *label = (UILabel *)cell; 
        label.text = (NSString *)key;
        label.frame = CGRectMake(0 + constant, 0, 30, 30);

        constant = 20 + CGRectGetMaxX(label.frame);
        }

I’m missing the subview piece. And I’m puzzled why if I add an NSLog of the fast enumeration, the output will show all strings in the array, but I can only display the first (ie myString1 in one row and myString2 in a second row without myString3).

<dict>
    <key>TitleKey</key>
    <string>myTitle1</string>
    <key>ArrayKey</key>
    <array>
        <string>myString1</string>
    </array>
</dict>
<dict>
    <key>TitleKey</key>
    <string>myTitle2</string>
    <key>ArrayKey</key>
    <array>
        <string>myString2</string>
        <string>myString3</string>
    </array>
</dict>
  • 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-25T06:26:29+00:00Added an answer on May 25, 2026 at 6:26 am

    Mystifying why this code is working at all. I am sure you are posting only partial code.

    1. UILabel *label = (UILabel *)cell; will create a pointer to exactly
      the same item cell and overwrite whatever is there.
    2. If dictionary is nil then [dictionary
      objectForKey:@"ArrayKey"]
      must cause a crash.
    3. id key should be NSString *key in order to assign it to
      label.text.
    4. You are not adding the label anywhere as a subview.

    You need at least a [cell.contentView addSubView:label];.

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

Sidebar

Related Questions

I am attempting to read a text file into a linear linked list of
I am attempting to read the results from a SQL query into a List(Of)
I'm attempting to read from an XML document in WP7 and have run into
I am attempting to read an array of key index UND using the following
I have data stored in a SQL database that I'm attempting to read into
While attempting to read data from memory into an enum via the following code,
I am attempting to read in from a txt file strings that are very
I am attempting to read from a url into a System.IO.Stream object. I tried
I'm attempting to read the file.txt into java line by line and then when
I'm attempting to read a specific value from an xml parameter passed into a

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.