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

The Archive Base Latest Questions

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

Have an error message on some properties. The error messages are commented out in

  • 0

Have an error message on some properties. The error messages are commented out in the following code. Don’t understand why I get this error message even though the properties are declared and synthesized in other files?

PlayersViewController.m

#import "PlayersViewController.h"
#import "Player.h"
#import "PlayerCell.h"


@implementation PlayersViewController

@synthesize players;


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
    // Return the number of rows in the section.
    return [self.players count];
}

- (UIImage *)imageForRating:(int)rating
{
    switch (rating) {
        case 1:return [UIImage imageNamed:@"1StarSmall.png"];
        case 2:return [UIImage imageNamed:@"2StarsSmall.png"];
        case 3:return [UIImage imageNamed:@"3StarsSmall.png"];
        case 4:return [UIImage imageNamed:@"4StarsSmall.png"];
        case 5:return [UIImage imageNamed:@"5StarsSmall.png"];

    }
}

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

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PlayerCell"];
    Player *player = [self.players objectAtIndex:indexPath.row];
    cell.nameLabel.text = player.name; /*property 'nameLabel' not found on object of tupe "UITableViewCell" */
    cell.gameLabel.text = player.game; /*property 'gameLabel' not found on object of tupe "UITableViewCell" */
    cell.ratingImageView.image = [self imageForRating:player.rating]; /*property 'ratingImageView' not found on object of tupe "UITableViewCell" */
    return cell;
}

The properties are declared and implemented in the following two files:

PlayerCell.h

#import <Foundation/Foundation.h>

@interface Player : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *game;
@property (nonatomic, assign) int rating; 

@end

PlayerCell.m

#import "Player.h"

@implementation Player

@synthesize name;
@synthesize game;
@synthesize rating;

@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-05-27T18:26:06+00:00Added an answer on May 27, 2026 at 6:26 pm

    UITableViewCell does not have a property called nameLabel, gameLabel or ratingImageView. If you are using your own custom UITableViewCell subclass then you need to tell the compiler that you’re sending messages to an instance of a PlayerCell and not UITableViewCell.

    do it like this

    PlayerCell *cell = (PlayerCell *) [tableView dequeueReusableCellWithIdentifier:@"PlayerCell"];

    Alternatively, you can use id and the compiler won’t have a problem if you don’t use dot notation but I’d use the explicit class version for clarity.

    id cell = [tableView dequeueReusableCellWithIdentifier:@"PlayerCell"];
    [cell nameLabel].text = @""; //etc
    

    As an aside – if that’s your actual code then you’re not instantiating your UITableViewCells which could also prove problematic.

    static NSString *CellIdentifier = @"Cell";
    
    PlayerCell *cell = (PlayerCell *)[tableView dequeueReusableCellWithIdentifier:@"PlayerCell"];
    if (nil == cell){
      cel = [[[PlayerCell alloc] yourInitMethodWithCellIdentifier:CellIdentifier] autorelease];
    }
    Player *player = [self.players objectAtIndex:indexPath.row];
    cell.nameLabel.text = player.name;
    cell.gameLabel.text = player.game;
    cell.ratingImageView.image = [self imageForRating:player.rating];
    return cell;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been helping someone debug some code where the error message was Day
I have the following CPP code snippet and the associated error message: Code snippet
I have this error message: Msg 8134, Level 16, State 1, Line 1 Divide
I keep getting the following error message ERROR 1064 (42000): You have an error
I have referred this for creating error message tool tips, to be displayed continuously
I have a form that has some indexed properties. When i submit this form
I'm trying to do some spring validation with the error messages in properties files.
I have one user who gets an error message when he closes his browser.
I have a table row that has the error message in it. <tr runat=server
I am getting an error message expression must have constant value when initializing an

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.