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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:04:32+00:00 2026-06-02T17:04:32+00:00

I have an array of reviews which I am outputing into a grouped table.

  • 0

I have an array of reviews which I am outputing into a grouped table. I want each review to be in its own tableview section when I sent the sections method to [array count] it just repeats the same group for as many items are in the array. Any idea’s how I can do this? I hope it makes sense. Thanks

–EDIT–

Added a picture of what I want to achieve and the cellForRow/Section/DidSelectRowMethod’s
I hope this clarify’s everything

enter image description here

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

    static NSString *CellIdentifier = @"Cell";
    CustomCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) 
    {
        cell = [[[CustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];

    }


    cell.primaryLabel.text = [object objectForKey:@"comment"];

    if([[object objectForKey:@"rating"] isEqualToString:@"0"])
    {
        cell.myImageView.image = [UIImage imageNamed:@"rating_0.png"];
    }
    if([[object objectForKey:@"rating"] isEqualToString:@"1"])    {
        cell.myImageView.image = [UIImage imageNamed:@"rating_1.png"];
    }
    if([[object objectForKey:@"rating"] isEqualToString:@"2"])
    {
        cell.myImageView.image = [UIImage imageNamed:@"rating_2.png"];
    }
    if([[object objectForKey:@"rating"] isEqualToString:@"3"])
    {
        cell.myImageView.image = [UIImage imageNamed:@"rating_3.png"];
    }
    if([[object objectForKey:@"rating"] isEqualToString:@"4"])
    {
        cell.myImageView.image = [UIImage imageNamed:@"rating_4.png"];
    }
    if([[object objectForKey:@"rating"] isEqualToString:@"5"])
    {
        cell.myImageView.image = [UIImage imageNamed:@"rating_5.png"];
    }


    return cell;

}


// Override if you need to change the ordering of objects in the table.
- (PFObject *)objectAtIndex:(NSIndexPath *)indexPath 
{ 
    return [self.objects objectAtIndex:indexPath.row];
}

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    PFObject *object = [self.objects objectAtIndex:indexPath.row];
    Review *review = [[Review alloc] initWithNibName:@"Review" bundle:nil];
    review.Name = [object objectForKey:@"userId"];
    NSLog(@"%@",[object objectForKey:@"userId"]);
    review.rating = [object objectForKey:@"rating"];
    review.comments = [object objectForKey:@"comment"];

    [self.navigationController pushViewController:review animated:YES];

    [review release];

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{
    return [self.objects count];
}
  • 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-02T17:04:33+00:00Added an answer on June 2, 2026 at 5:04 pm

    Since you want every review to be in a separate group you have to use index path’s section instead of the row for the array index (the row will always be 0 since you only have one row per section):

    // Override if you need to change the ordering of objects in the table.
    - (PFObject *)objectAtIndex:(NSIndexPath *)indexPath 
    { 
        return [self.objects objectAtIndex:indexPath.section];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which displays reviews written by users about products. The problem
I have venue records where each has reviews, each review can be rated 1
I have a view where several reviews are displayed for a product. Each review
i have a array that returns some numbers. and i want to add those
I have an array of objects which will be the basis for a certain
I have a class named DataBoundObject which is quite big. And works good. Its
I have array of two textboxes in a table, on blur of one text
I have array INPUTFILES with n files INPUTFILES=( file_0 ... files_n-1 ) And i
I have array of hashes: @array = [{:id => 1, :status=>R}, {:id => 1,
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>

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.