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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:30:30+00:00 2026-06-11T14:30:30+00:00

Possible Duplicate: sectioned UITableView sourced from a pList I am having a hard time

  • 0

Possible Duplicate:
sectioned UITableView sourced from a pList

I am having a hard time trying to set the text label of the cell to the values of the strings in my plist. The app crashes on cell.textlabel.text = [array objectAtIndex:indexPath.row];. I’m pretty sure everything else is good, just don’t know that last part. Thanks in advance.

Here is my plist:

Root - Array
    Item 0 - Dictionary
        Key 0 - Array
            Item 0 - String - Value 0
        Key 1 - Array
            Item 1 - String - Value 1

Here are my tableview data source methods:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

return _objects.count;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

NSDictionary *dict = [_objects objectAtIndex:section];
return [dict.allValues count];

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];

NSArray *array = [_objects objectAtIndex:indexPath.section];
cell.textLabel.text = [array objectAtIndex:indexPath.row];

return cell;

}
  • 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-11T14:30:31+00:00Added an answer on June 11, 2026 at 2:30 pm

    well the structure of your _object is not clear. I am assuming it refers to Item 0 - Dictionary in the plist.

    in numberOfRowsInSection: you refer to it as a dictionary:

    NSDictionary *dict = [_objects objectAtIndex:section]
    

    while in cellForRowAtIndexPath: you refer to it as an array:

    NSArray *array = [_objects objectAtIndex:indexPath.section];
    

    anyway, if my assumption is correct then change the cellForRowAtIndexPath code to the following:

    NSDictionary *dict = [_objects objectAtIndex:indexPath.section];
    NSarray *array = [dict objectForKey:myKey]; //myKey is whatever key you are assigning
    cell.textLabel.text = [array objectAtIndex:indexPath.row];
    

    hope this helps.

    EDIT:

    well you can restructure your plist to achieve that. You basically just get rid of the dictionary level.. try something like this:

    Root - Array
        Item 0 - Array                   <-- this is a section
            Item 0 - String - Value 0    <-- this is a cell
        Item 1 - Array                   <-- section
            Item 0 - String - Value 1    <-- cell
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Merging: hg/git vs. svn Hi, I'm a long time SVN user and
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: How to implement re-ordering of CoreData records? I'm trying to find a
Possible Duplicate: hide an entry from Toc in latex Appendix A Section 1 A.1
Possible Duplicate: When navigating through word-wrapped text in VIM, how to make the selector
Possible Duplicate: Call-time pass-by-reference has been deprecated While it may be documented somewhere on
Possible Duplicate: synchronized block vs synchronized method? From accepted answer to this question: In
Possible Duplicate: Simple and clean xml manipulation in PHP I trying to reference specific
Possible Duplicate: style type="text/css" … what else is there? I see that when defining
Possible Duplicate: Opening the Settings app from another app I am calling: [[UIApplication sharedApplication]

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.