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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:00:33+00:00 2026-05-29T20:00:33+00:00

I am using this code for multiple cell types in a UITableView The problem

  • 0

I am using this code for multiple cell types in a UITableView

The problem is that the cell text is invisible. The code for cellForRowAtIndexPath as well as the cell class code is given below:

code:

static NSString *kCellIdentifier = @"NewsViewControllerTableCell";
static NSString *kCellIdentifier2 = @"SubscribeCell";


if ((indexPath.row==0) && ([[NSUserDefaults standardUserDefaults] boolForKey:@"subscribeButtonOption"]))
{
   SubscribeCell* cell = (SubscribeCell*)[tableView dequeueReusableCellWithIdentifier:kCellIdentifier2];

    if (cell == nil) {
        cell = [[[SubscribeCell alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 35.0) reuseIdentifier:kCellIdentifier2] autorelease];
        cell.contentView.backgroundColor = kColorR53G53B53;
        cell.subscribeLabel.font = kLucidaSansStdFontBold_14;
        cell.subscribeLabel.textColor = [UIColor whiteColor];
    }

    cell.subscribeLabel.textColor=[UIColor redColor];
   cell.subscribeLabel.text = @"+ SUBSCRIBE TO NEWSLETTER";


   cell.selectedBackgroundView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
   cell.selectedBackgroundView.backgroundColor =kColorR53G53B53;


   [cell setNeedsDisplay];
    return cell;           
}

else
{
   //another cell
 }

=========

header:

#import <UIKit/UIKit.h>

@interface SubscribeCell : UITableViewCell{
    UILabel *subscribeLabel;
}

@property(nonatomic, retain) UILabel *subscribeLabel;

 @end

and implementation class:

#import "SubscribeCell.h"

@implementation SubscribeCell
@synthesize subscribeLabel;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization

        subscribeLabel=[[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 323.0, 40.0)];
        subscribeLabel.textColor=[UIColor whiteColor];
        self.backgroundColor=kColorR53G53B53;

    }
    return self;
}
  • 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-29T20:00:34+00:00Added an answer on May 29, 2026 at 8:00 pm

    Check to see if subscribeLabel is nil. You’re creating it in initWithNibName:bundle: but are initializing with initWithFrame:reuseIdentifier:, so it’s not reaching your label creation code.

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

Sidebar

Related Questions

I am using this code to download multiple file. My problem is that it
I am using this code to sum values from multiple radio buttons : $(document).ready(function(){
I would select multiple DOM elements using a typical code such as this: $('#ele1,
I'm using this code, to make a request to a given URL: private static
I'm using this code, and I get the stack trace that is listed below.
I tried using this code to start multiple Activities from a parent activity: for
I was inserting multiple arrays into my database using this code: $queries_cols = array();
I am not able to upload multiple files.I am using this code. Here itr.hasNext()
I'm using Zend_Form for an application form using this code: class Form_ApplicationForm extends Zend_Form
Im getting an error using this code below. I have tried multiple ways and

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.