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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:49:22+00:00 2026-06-07T06:49:22+00:00

I’m trying to create a Settings for our app. I’m not sure what is

  • 0

I’m trying to create a Settings for our app. I’m not sure what is happening here. I have a UITableViewSyleGrouped and in each section of the table, there is 1 row. For my particular row, it shows the person’s name. If you click on it, then it pushes to a new tableView that has the list of people to choose from, then when you pop back, the label gets updated, but the label is truncated when I go from a smaller name to a bigger name. I’m trying to create a Settings for our app. Some of the fields look like:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger row = [indexPath row];
    if (tableView == _settingsTableView) {
        UITableViewCell *cell = nil;

        NSNumber *aSection = [_tableArray objectAtIndex:indexPath.section];

        if ([aSection integerValue] == SOUNDS)
        {
            cell = [tableView dequeueReusableCellWithIdentifier:@"SwitchCell"];
            if (cell == nil)
            {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SwitchCell"] autorelease];
            }
            cell.textLabel.text = @"Sounds";
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectZero];
            cell.accessoryView = switchView;
            [switchView setOn:[[Settings sharedInstance] playSounds] animated:NO]; // initialize value from Settings
            [switchView addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEventValueChanged];
            [switchView release];
        }
        else if ([aSection integerValue] == PERSON) {
            cell = [tableView dequeueReusableCellWithIdentifier:@"PersonCell"];
            if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"PersonCell"] autorelease];
            }
            Person *p = [_personArray objectAtIndex:row];
            cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", p.firstName, p.lastName];
                        NSLog(@"cL: %@", NSStringFromCGRect(cell.textLabel.frame));
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
        }
  return cell;
}

My PERSON section gives the user the ability to change People. That code in didSelectRowAtIndexPath is

else {
    Person *p = [_personArray objectAtIndex:row];
    NSUInteger oldRow = [_lastIndexPath row];
    if (oldRow != row) {
        dmgr.currentPerson = p;

        // Put checkmark on newly selected cell
        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryCheckmark;

        // Remove checkmark on old cell
        UITableViewCell *oldCell = [tableView cellForRowAtIndexPath:_lastIndexPath];
        oldCell.accessoryType = UITableViewCellAccessoryNone;
        [_settingsTableView deselectRowAtIndexPath:_lastIndexPath animated:YES];
        self.LastIndexPath = indexPath;

        // Update the cell 
        NSIndexPath *path = [NSIndexPath indexPathForRow:0 PERSON];
        UITableViewCell *theCell = [_settingsTableView path];

        theCell.textLabel.text = [NSString stringWithFormat:@"%@ %@", p.firstName, p.lastName];
        [theCell setNeedsDisplay];                
        NSLog(@"ceLL: %@", NSStringFromCGRect(theCell.textLabel.frame));

    }
}

What happens is the label is truncated until I click on the label. (e.g. John D… instead of John Doe). Why does the label not get updated?

I tried looking at the frames, and I’m not sure if that has something to do with it or not. My output is:

cL: {{0, 0}, {0, 0}}
ceLL: {{10, 11}, {76, 21}}
  • 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-07T06:49:23+00:00Added an answer on June 7, 2026 at 6:49 am

    The textLabel field of a UITableViewCell is a regular UILabel. You can set this property to cause it to scale down the text to fit:

     theCell.textLabel.adjustsFontSizeToFitWidth = YES;
    

    You can also set a minimum font size

     theCell.textLabel.minimumFontSize  = whatever
    

    Take a look at the Documentation on UILabel it will help you a lot.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.