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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:33:42+00:00 2026-05-27T17:33:42+00:00

I’m trying to create a custom cell for use in a grouped style UITableView

  • 0

I’m trying to create a custom cell for use in a grouped style UITableView. However when I run my code I keep hitting an error at the point marked in my code. I have no idea what is wrong though. Please could someone help me out?

.h file:

@interface CustomRecommendedStepCell : UITableViewCell
{
    UILabel *stepNumber;
    UITextView *stepInstruction;
}


@property(nonatomic, retain)IBOutlet UILabel *stepNumber;
@property(nonatomic, retain)IBOutlet UITextView *stepInstruction;


@end

.m file:

#import "CustomRecommendedStepCell.h"

@implementation CustomRecommendedStepCell
@synthesize stepNumber, stepInstruction;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

    if (self)
    {
        UIImageView *backgroundView = [[UIImageView alloc] init];
        [backgroundView setImage:[UIImage imageNamed:@"Slate_bg.png"]];
        self.backgroundView = backgroundView;
        self.backgroundColor = [UIColor clearColor];

        stepNumber = [[UILabel alloc] init];
        stepNumber.textAlignment = UITextAlignmentLeft;
        stepNumber.font = [UIFont fontWithName:kCustomFont1 size:40];
        stepNumber.textColor =[UIColor whiteColor];
        stepNumber.backgroundColor = [UIColor clearColor];

        stepInstruction = [[UITextView alloc] init];
        stepInstruction.editable = NO;
        stepInstruction.textAlignment = UITextAlignmentLeft;
        stepInstruction.font = [UIFont fontWithName:kCustomFont1 size:23];
        stepInstruction.textColor =[UIColor whiteColor];
        stepInstruction.backgroundColor = [UIColor clearColor];

        [self.contentView addSubview:stepNumber];
        [self.contentView addSubview:stepInstruction];
    }

    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];

    stepNumber.frame = CGRectMake(20, 20, 50, 60);        // PROBLEM OCCURS HERE!
    stepInstruction.frame = CGRectMake(70, 20, 200, 60);
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end

Here is a copy of the log messages I’m receiving:

2011-12-22 20:34:09.801 Some App[30945:10703] -[__NSCFString setFrame:]: unrecognized selector sent to instance 0x756b340
2011-12-22 20:34:09.802 Some App[30945:10703] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString setFrame:]: unrecognized selector sent to instance 0x756b340'
*** First throw call stack:
(0x11f052 0x1845d0a 0x120ced 0x85f00 0x85ce2 0xd7c1 0x778322 0x120e72 0x359792d 0x35a1827 0x35a1922 0x771f47 0x924edd 0x7d2fe1 0x7d3589 0x7bedfd 0x7cd851 0x778301 0x120e72 0x359792d 0x35a1827 0x3527fa7 0x3529ea6 0x3529580 0xf39ce 0x8a670 0x564f6 0x55db4 0x55ccb 0x3ab4879 0x3ab493e 0x739a9b 0x2128 0x2085 0x1)
terminate called throwing an exception
  • 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-27T17:33:43+00:00Added an answer on May 27, 2026 at 5:33 pm

    In your tableView:cellForRowAtIndexPath: method you seem to do something like

    cell.stepNumber = @"text";
    

    instead of

    cell.stepNumber.text = @"text";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to create an if statement in PHP that prevents a single post
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.