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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:26:45+00:00 2026-06-05T03:26:45+00:00

When I push a UIViewController onto my UINavigation controller like: [(UINavigationController *)self.parentViewController pushViewController:[[[Fonts alloc]

  • 0

When I push a UIViewController onto my UINavigation controller like:

[(UINavigationController *)self.parentViewController pushViewController:[[[Fonts alloc] initWithNibName:@"Fonts" bundle:nil] autorelease] animated:YES];

Where Fonts.xib is a UIView with only UITableView controlled by a Fonts object that is a subclass of UIViewController and acts as the UITableView’s dataSource and delegate.

In the Fonts object I create a UITableViewCell like:

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

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"BlahTableViewCell"];

    if (!cell) {
        cell = [[UITableViewCell alloc]
                initWithStyle: UITableViewCellStyleDefault
                reuseIdentifier: @"BlahTableViewCell"];
        [cell autorelease];  // Delete for ARC
    }

    return cell;

}

And then I change the font of the cell here:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    [cell.textLabel setFont:[(UIFont *)[self.listOfFonts objectAtIndex:indexPath.row] fontWithSize:cell.textLabel.font.pointSize]];
    cell.textLabel.text = [(UIFont *)[self.listOfFonts objectAtIndex:indexPath.row] fontName];
}

listOfFonts is an NSArray of UIFont objects.

When the view appears it looks like UITableView without changed fonts

If I call reloadData on the UITableView or if I drag the UITableViewCells off screen with my finger and let them bounce back they are redrawn and the view the cells display with the labels having their fonts changed.

It seems like the issue is the UITableViewCells are being drawn too early. If I delay the drawing of them everything looks correct but I want the UITableView to be displaying correctly when the UINavigationController slides my view into place.

Any idea what I am doing wrong?

EDIT: I uploaded a simple and straightforward example of my issue to Dropbox. http://dl.dropbox.com/u/5535847/UITableViewIssue.zip

  • 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-05T03:26:47+00:00Added an answer on June 5, 2026 at 3:26 am

    SOLVED IT!

    Ok so I was having exactly the same issues as the original poster and this was the problem.

    The line that’s causing issues is:

    [cell.textLabel setFont:[(UIFont *)[self.listOfFonts objectAtIndex:indexPath.row] fontWithSize:cell.textLabel.font.pointSize]];
    

    Specifically, your issue is because you’re trying to feed the cell’s textLabel its own pointSize, but pointSize doesn’t exist yet so strange bugs occur instead. For me, I noticed that a “transform” was failing due to a singular matrix being non-invertible. As soon as I hardcoded a standard value as my pointSize I saw all my labels draw with the proper font instantly. Note: this makes sense as to why a redraw worked, because then your textLabel does indeed have a pointSize.

    In any case, you need to explicitly set your pointSize here, no using what the textLabel “already has” because it doesn’t have anything until you’re “reloading” a cell.

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

Sidebar

Related Questions

When I try to push a UIViewController subclass ( MissionViewController ) onto a UINavigationController
I have a UINavigationController onto which I push a 'loading screen' UIViewController whilst I
I have a UIViewcontroller that I want to push onto a UINavigationController, which in
I have a UINavigationController with which I push UIViewControllers onto using pushViewController:animated: . After
I have UINavigationController and UIViewController, then I push another viewcontroller, but I don't need
I have a UINavigationController with a root view controller and then I push a
I use 1 UINavigationController in my app, and everytime I push a UIViewController I
I'm obviously missing something... In my iOS app, I push a UIViewController onto a
I can't seem to push a UITableViewController onto a UIViewController using the following code:
So basically, how can I push a UIViewController from a UITableView. I have an

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.