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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:27:15+00:00 2026-05-26T22:27:15+00:00

This code compiles fine without warnings but the substring does not appear in the

  • 0

This code compiles fine without warnings but the substring does not appear in the cells. Any idea why?

TableExampleViewController.m

#import "TableExampleViewController.h"

@implementation TableExampleViewController

@synthesize colorNames;

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

 - (void)viewDidLoad
{
    [super viewDidLoad];
    self.colorNames = [[NSArray alloc] initWithObjects:@"Red", @"Green", @"Blue",     @"Indigo", @"Violet", nil];
}

 // Customize the number of rows in the table view
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section     {
     return [self.colorNames count];
}

// Customize the appearance of table view cells
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:    (NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

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

     // Configure the cell
    UIImage *cellImage = [UIImage imageNamed:@"apple.png"];
                      cell.imageView.image = cellImage;
    NSString *colorString = [self.colorNames
                       objectAtIndex:[indexPath row]];

    cell.textLabel.text = colorString;
    NSString *subtitle = [NSString stringWithString:@"All about the color "];
    subtitle = [subtitle stringByAppendingString:colorString];
    cell.detailTextLabel.text = subtitle;

    return cell;
}
  • 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-26T22:27:16+00:00Added an answer on May 26, 2026 at 10:27 pm

    Change:

    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    

    To:

    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
    

    The default style doesn’t have a detailTextLabel.

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

Sidebar

Related Questions

This code compiles fine: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators,
I'm having a hard time using std::string::iterators in C++. This code compiles fine (still
Please check this code out it compiles and runs absolutely fine.. The question is
I have non-template class with a templatized constructor. This code compiles for me. But
This code compiles fine in Java <= 1.4. Java 1.6 bitches and moans with
i am using this code to check if my glsl shader compiled fine. glGetObjectParameterivARB(obj,
This code compiles: private static void Main(string[] args) { bool? fred = true; if
I am a bit confused why this code compiles. I leave out the necessary
I have this code which compiles and works as expected: class Right {}; class
This piece of code compiles and runs as expected on GCC 3.x and 4.x:

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.