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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:34:39+00:00 2026-05-31T11:34:39+00:00

I got a hard job to be done. I try to attach additional information

  • 0

I got a hard job to be done. I try to attach additional information to a UITableViewCell.
The tableViewCells got buttons inside that I subclassed to do that (I’m passing a NSString).

Now, when the user clicks on a tableRow, I want to fire an other method and want to pass the same string.
I created a subclass of UITableViewCell and added the string to it.

But I can’t get the value of the string in tableView:didSelectRowAtIndexPath:.
That’s because UITableView returns an UITableViewCell and not my custom subclass:

[tableView cellForRowAtIndexPath:indexPath].passString
    → /* Property 'passString not found on object of type UITableViewCell */

When I do NSLog(@"%@", [tableView cellForRowAtIndexPath:indexPath]); I can see the property on the log.

Now my question:
How can I get this subclass property in other methods?!

I don’t want to subclass UITableView as well. I’d end up subclassing like every UIElement I’m using :'(

Thanks for help, greetings
Julian

  • 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-31T11:34:40+00:00Added an answer on May 31, 2026 at 11:34 am

    Jullian just type cast UITableViewCell to your custom class like

    CustomCell *cell = (CustomCell*)[tableView cellForRowAtIndexPath:indexPath];
    cell. passString; //it will work
    

    or you can pass message instead of dot operator
    [[tableView cellForRowAtIndexPath:indexPath] passString];

    it will give you warning but will work if it is the object of you CustomCell. Prefer using first method as I don’t like warnings in my code.

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

Sidebar

Related Questions

Right now we've got a hard-coded set of characters that we check for --
Overflow :3 I've got a kind of hard-case question. So I'll try clearly explain
OK this is presumably a hard one, I've got an pyGTK application that has
This might be a little hard to follow. I've got a function inside an
I got the impression that some problems are just to hard to unit test.
I've got some Excel spreadsheets that are hitting the database pretty hard (100+ queries
I've got to make some changes to an app that has many hard-coded paths.
Got a problem that I'm having a hard time getting started on. Not a
this is probably not that hard to do. But I've got two text files.
This shouldn't be that hard that one may think, if I got it right.

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.