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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:11:56+00:00 2026-05-16T20:11:56+00:00

I have a UILabel in a custom UITableViewCell that gets resized when the device

  • 0

I have a UILabel in a custom UITableViewCell that gets resized when the device is rotated. The text in this label needs to be recalculated after the rotation because I am cutting it down to size and appending some text at the end.

E.g. the datamodel has: “This is a run-on sentence that needs to stop.”

In portrait mode it becomes “This is a run-on sent… more”

In landscape mode it becomes “This is a run-on sentence that… more”

From (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
I am able to access the visible UITableViewCells and update the descriptions.

The problem seems to be that there are UITableViewCells that are cached but I can’t get to. When I scroll the UITableView after a rotation, one or two cells that are below the visible area after the rotation don’t have the correct text in the label. So they haven’t been rendered via (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath – but they weren’t returned by [tableView visibleCells] (or via looping through all views returned via [tableView subViews]).

I’ve tried to access the “extra” cells via this method:

for (int index=max + 1; index < max + 3 && index < [cellTypes count]; index++) {
    NSIndexPath *updatedPath = [NSIndexPath indexPathForRow:index inSection:0];
    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:updatedPath];
    if (cell == nil) { continue; }
    [self updateCellForRotate:cell forRow:index];
}

(where max is the biggest row returned from visibleCells) but cell is always nil.

Is there anyway to flush the cache of UITableViewCells so that they don’t get re-used? Or to access them so I can update them?

Thanks!

  • 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-16T20:11:57+00:00Added an answer on May 16, 2026 at 8:11 pm

    Firstly, to reload all of your table cells use [self.tableView reloadData]

    Secondly, add the line of code that is responsible for the shrinking inside the (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method.

    Example:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        //Some identifier and recycling stuff
    
        if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
            //Make labels smaller
        }
        else {
            //Make them bigger
        }
    }

    Or you can just call your updateCellForRotate:forRow: method when making them. But I’m not sure how that function works, so I can’t be too specific.

    • 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 that contains a UISlider control and a UILabel which
I have a custom UITableViewCell that consists of a UIImageView and a UILabel. The
I have a UILabel with right-aligned text that may vary from between three to
I have a UILabel thats inside a Custom UITableViewCell, I am trying to get
In my app I have custom UITableViewCell , and I have UIStepper and UILabel
I have a custom UITableViewCell with a UILabel and a UITextView in it. I
I am a newbie. I have a custom UITableViewCell with 3 items: a UILabel
I have a custom UITableViewCell: @interface EditingTableViewCell : UITableViewCell <UITextFieldDelegate> { UITextField *editableText; UILabel
I am facing this very weird problem, I have created a custom UITableViewCell on
I have a UITableView that I am populating with custom UITableViewCell in interface builder.

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.