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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:14:27+00:00 2026-06-07T04:14:27+00:00

So I has custom table cell defined via builder and loaded via nib (and

  • 0

So I has custom table cell defined via builder and loaded via nib (and it has a property of its idexPath) and it has 2 buttons. I want to show table with dynamically changed state of those buttons. IE 1st cell – both enabled, 2nd cell – both buttons disabled, 3rd – 1st btn enabled and 2nd btn disabled and so on.
Now if I use 1 reuse identifier all the cells will look the same which I don’t want. I want every cell has its own view which means unique reuse id for every cell.
But how to reach this? If I’ll create some unique cellId at

- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

which will be a string then I could not create the same string in meaning of objects. I could create string with same text but this will be another object so I couldn’t get the previously created cell with such cellId again via reuseId. So i cant change buttons state of one cell and update it then with

[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:path] withRowAnimation:UITableViewRowAnimationNone];

but only the [tableView reloadData]; will work.

  • 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-07T04:14:28+00:00Added an answer on June 7, 2026 at 4:14 am

    I have a feeling that you’re only setting the state of your cell’s buttons when you first create the cell with initWithStyle:reuseIdentifier:. This is the wrong way to go about things. You need to set the state for your cells in every call to cellForRowAtIndexPath, whether they’re being re-used or not. In your case, if each cell has the same UI (two buttons) then they should all share one reuseIdentifier. Your datasource should be responsible for maintaining you cells’ states, not the UITableViewCell objects.

    It’s the difference between this:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
         myCustomCell *cell = (myCustomCell *)[myTable dequeueReusableCellWithIdentifier:@"myCellIdentifier"];
         if (cell == nil) {
           // Load cell from nib here and set the cell's button states based on indexPath
         }
        return cell;
    }
    

    and this:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
         myCustomCell *cell = (myCustomCell *)[myTable dequeueReusableCellWithIdentifier:@"myCellIdentifier"];
         if (cell == nil) {
           // Load cell from nib here
         }
        // set the cell's button states based on indexPath here
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a table view. In each cell (row), i want to show two buttons.
I have a UITableview made up with a custom cell loaded from a nib.
I have a table view that has custom cells. In every cell I have
I'm trying to create a custom table view cell that has a button on
I built a table view, with Custom Table View Cells, where each cell has
I have a custom table cell which has a custom ui view in it.
I am using a NIB file to layout a custom table view cell. This
I have a custom table that has a custom format to it, which makes
I have a custom table created which has a foreign constraint on the core_website
I'm creating a custom table that has a button which allows a user to

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.