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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:59:08+00:00 2026-05-25T10:59:08+00:00

I have a UITableViewCell that is being instantiated (in the cellForRowAtIndexPath method) with [cell

  • 0

I have a UITableViewCell that is being instantiated (in the “cellForRowAtIndexPath” method) with

[cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];

When the “Accessory Button” is clicked, I have a UIDatePicker being popped that is supposed to set the text of the cell to the date being selected. The Picker shows up and my cell is not nil, however, I cannot see the actual text (date) of the cell until I click it (the cell, not the “accessory button”).

Here is the code that is setting text:

targetCell.textLabel.text = [formatter stringFromDate:_datePicker.date];

targetCell is an instance variable being set when the method: “accessoryButtonTappedForRowWithIndexPath” is called.

Like I said, I know the text is being set in the cell because when I click the actual cell I can see the date selected in the picker.

  • 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-25T10:59:09+00:00Added an answer on May 25, 2026 at 10:59 am

    It seems like you are trying to modify the currently displayed table view cell directly. Even if you manage to change it this way, this will still not work because when your row scrolls out of view, its corresponding cell is re-used for another row. So your changes will either be lost, or you will display something incorrectly.

    The correct way of managing this is to:

    1. Change your data source, and not the cell, when a value is picked from the date picker
    2. Reload the view for the cell by either reloading
      • the whole table view using -[UITableView reloadData], or
      • just that row using -[UITableView reloadRowsAtIndexPaths:withRowAnimation:]

    Using either of these methods will result in the table view data source’s -tableView:cellForRowAtIndexPath: being called, which will update the row with a new cell. So the correct date will be displayed for this row even if it scrolls out of view.

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

Sidebar

Related Questions

I have a custom UITableViewCell with a UITextField and a method that is being
I have a class A that inherits UITableViewCell (to customize a table cell). It
I have a text field that is being shown in a UITableViewCell and I
I have a custom UITableViewCell that I use like this: AppTableCell *cell = [tableView
I understand that UITableView will call -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method to get
I want to have a UITableViewCell that is not selectable while its accessory view
I have the following method that loads cells into my table. The cell with
I have a UITextField that I put into a UITableViewCell that I put into
Similar to this question I have a custom subclass of UITableViewCell that has a
I have a UITableView cell that is going to have a variable size depending

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.