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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:31:20+00:00 2026-06-13T05:31:20+00:00

This is essentially the layout I want: The UITableView at the bottom should accomodate

  • 0

This is essentially the layout I want:

enter image description here

The UITableView at the bottom should accomodate comments to a specific post, adding a row for each comment.

The UITableView at the bottom is wired to commentTable; all other elements are wired accordingly as well.

When I build and run, no errors, but I only see one empty table cell below the post.

I know there’s something missing in loading/passing data to my table, but I wonder if someone can give me a direction on how to make this work.

DetailViewController.h

#import <UIKit/UIKit.h>
@interface DetailViewController : UIViewController {
    IBOutlet UIImageView  *postThumbView;
    IBOutlet UILabel      *postTextLabel;
    IBOutlet UIImageView  *postAuthorPictureView;
    IBOutlet UILabel      *postAuthorNameLabel;
    IBOutlet UILabel      *postTimestampLabel;
    IBOutlet UIScrollView *scroller;
    IBOutlet UITableView  *commentTable;
}

@property (strong, nonatomic) id detailItem;
@end

DetailViewController.m

#import "DetailViewController.h"

@interface DetailViewController ()

- (void)configureView;

@end

@implementation DetailViewController;

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self configureView];
}

- (void)configureView
{
    if (self.detailItem) {
        NSDictionary *post           = self.detailItem;
        NSString     *postText       = [post objectForKey:@"post_text"];
        ...

        postTextLabel.text  = postText;
        ...
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    NSDictionary *post           = self.detailItem;
    NSDictionary *commentThread  = [post objectForKey:@"comment"];

    return commentThread.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"commentCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    NSDictionary *post           = self.detailItem;
    NSDictionary *commentThread  = [post objectForKey:@"comment"];

    NSString     *commentText       = [commentThread objectForKey:@"comment_text"];
    NSString     *commentAuthorName = [commentThread objectForKey:@"comment_author_name"];

    cell.textLabel.text = commentText;
    cell.detailTextLabel.text = [NSString stringWithFormat:@"by %@", commentAuthorName];

    return cell;
}

@end
  • 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-13T05:31:22+00:00Added an answer on June 13, 2026 at 5:31 am

    You need to declare your view controller as the delegate and data source for the table view

    change this line in your .h file

    @interface DetailViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

    Then in your viewDidLoad

    commentTable.dataSource = self;
    commentTableView.delegate = self;
    [commentTableView reloadData];
    [self configureView];
    

    You can also look in the story board, and connect the outlets n the same way you connected commentTable to your UITableView, but by dragging in the opposite direction and selecting data source and delegate

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

Sidebar

Related Questions

So I have a DOM document that looks essentially like this <categories> <category id=1/>
This questions involves 2 different implementations of essentially the same code. First, using delegate
This question has been bugging me for a long time now but essentially I'm
So I essentially need to do this: String text = line1\n; text += line2\n;
Essentially, is there any way to make this code legal? main = print .
I have a schema that essentially looks like this: CREATE TABLE `data` ( `id`
This seems like a basic question, but I haven't found any clear answers. Essentially,
I'm writing a cache-eject method that essentially looks like this: while ( myHashSet.Count >
thanks in advance for looking at this. Essentially, I'm calling didInsertElement() and binding an
I've mapped out this cool idea for my personal web page. I essentially just

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.