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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:23:19+00:00 2026-06-13T07:23:19+00:00

I have successfully created my on cell object (based on UITableViewCell) and have successfully

  • 0

I have successfully created my on “cell” object (based on UITableViewCell) and have successfully used it while building a table via cellForRowAtIndexPath.

However, how do I deconstruct what I have done within didSelectRowAtIndexPath?

I currently receive the error “Incompatible pointer types initializing ‘MyCell *__strong’ with an expression of type ‘UITableViewCell'”

Given my object (MyCell) is based on UITableViewCell I don’t understand why I am getting this error.

Can you please help me understand what I am doing wrong.

My alternative is to use a “TAG” for each of the two labels in the cell and get them that way, but I am just experimenting here trying to learn more about how this all works.

Any help would be greatly appreciated.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"myCellID";
    MyCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    if (cell == nil) {
        cell = [[MyCell alloc]
                initWithStyle:UITableViewCellStyleDefault
                reuseIdentifier:CellIdentifier];
    }

cell.accountCode.text = @"0009810";
cell.accountName.text = @"Agent Name";

return cell;
}

Here is the other method. I get the error on MyCell *cell = [tableView cellForRowAtIndexPath:indexPath];

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

// Get the cell that was selected
MyCell *cell = [tableView cellForRowAtIndexPath:indexPath];

AccountRecord *accountRecord = [[AccountRecord alloc] init];
accountRecord.accountCode = cell.accountCode.text;
accountRecord.accountName = cell.accountName.text;

[self performSegueWithIdentifier:@"AccountDetail" sender:accountRecord];

}

And here is MyCell

#import <UIKit/UIKit.h>

@interface MyCell : UITableViewCell

@property (nonatomic,strong) IBOutlet UILabel *accountCode;
@property (nonatomic,strong) IBOutlet UILabel *accountName;

@end

Any help would be appreciated.

  • 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-06-13T07:23:21+00:00Added an answer on June 13, 2026 at 7:23 am

    Change this:

    MyCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    

    to the following:

    MyCell *cell = (MyCell *) [tableView cellForRowAtIndexPath:indexPath];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created an application which is workable on the >3.0 devices. However,
I have created a REST web service and successfully used it with a client.
I have successfully created a UITableView/UITableViewCell that is able to slide up and down
I have a custom UITableViewCell which I created in Interface Builder. I am successfully
I have successfully created my data source, which is a CLR object of the
I have successfully created a GMF editor which draws models based on my EMF
I have successfully created a disabled user in Active Directory via JNDI, but I
I have successfully created Web Services from MySQL Database using Netbeans tutorial . However,
I have successfully created a database table in android ( SQLite ). I am
I have successfully created a table using SQlite in android. There is a column

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.