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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:29:48+00:00 2026-05-24T04:29:48+00:00

I created my UITableViewCell programatically (no xib) and here’s how I have it in

  • 0

I created my UITableViewCell programatically (no xib) and here’s how I have it in my code:

- (id) initWithFrame: (CGRect)frame {
    self = [super initWithFrame: frame];
    if (self) {
        NSLog(@"CALLING INIT WITH FRAME");

        self.like_img = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 75, 30, 30)] autorelease];
        [self.contentView addSubview: self.like_img];

        self.comment_img = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 110, 30, 30)] autorelease];
        [self.contentView addSubview: self.comment_img];

        self.type_img = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 40, 30, 30)] autorelease];
        [self.contentView addSubview:self.type_img];

        self.avatar = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 30, 30)] autorelease];
        [self.contentView addSubview:self.avatar];

        self.post = [[[UITextView alloc] initWithFrame:CGRectMake(40, 40, 650, 100)] autorelease];
        [self.contentView addSubview:self.post];

        self.post_title= [[[UILabel alloc] initWithFrame:CGRectMake(40, 20, 650, 50)] autorelease];
        [self.contentView addSubview:self.post_title];

        self.post_detail = [[[UILabel alloc] initWithFrame:CGRectMake(40, 10, 650, 20)] autorelease];
        [self.contentView addSubview:self.post_detail];

    }

    NSLog(@"NOT MY SELF");
    return self;
}


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

    FTPostCell *cell = (FTPostCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSLog(@"INITIALIZING CELL");
        cell = [[[FTPostCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }

  //snip some code here
  return cell;
}

The issue is that I don’t see it calling the initWithFrame being called, why is this?
And therefore what I am seeing is just empty cells…

  • 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-24T04:29:48+00:00Added an answer on May 24, 2026 at 4:29 am

    initWithFrame is not called because you call

    initWithFrame: reuseIdentifier:

    replace

    - (id) initWithFrame: (CGRect)frame {
        self = [super initWithFrame: frame];
    

    with

    - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
        self = [super initWithFrame: frame reuseIdentifier:reuseIdentifier];
    

    Also please mind that initWithFrame:reuseIdentifier is a deprecated method and you should use initWithStyle:reuseIdentifier instead.

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

Sidebar

Related Questions

I have a custom UITableViewCell created through code (not Interface Builder). I have sub-views
I have created a UITableViewCell using UITableViewCellStyleValue1, which the Apple docs define as: A
I have setup a UITableView (320 wide) with a UITableViewCell created in IB, the
I have created a custom UITableViewCell , but when I dequeue the cell, sometimes
I have a custom UITableViewCell which I created in Interface Builder. I am successfully
I have a custom UITableViewCell created in IB. All my cells will have this
I have created a customized call that is called in UITableViewCell (cellForRowAtIndexPath) . Everything
I have created a UITableView with two cells, username and password using the code
I have UItableViewCell created with a nib file, and have put in my cell
I have created a button programmatically in a UITableViewCell and I want it to

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.