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

  • Home
  • SEARCH
  • 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 7786867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:29:52+00:00 2026-06-01T20:29:52+00:00

I’m sure this question is not unique, but I’ve not found other sources to

  • 0

I’m sure this question is not unique, but I’ve not found other sources to solve it. Actually, those have been causing more confusion. Please shed light if you can.

The crux of the issue is that I want to slide (-50) a UILabel in ONE cell of a 7 section 30ish row table with custom cells. After scrolling a couple other rows are moving this label, and they continue to move farther and farther as the scrolling continues.

You’ll note that the minus 50 x coordinate is in 2 places for testing. The first one, in cell == nil, never gets called. Why?? I thought that was the place to solve this problem.

Also not sure how to call initWithStyle (not for custom) or initWithCoder (created in storyboard) even if the cell was nil. ??

    NSArray *a = [[userDetailData objectAtIndex:[indexPath section]] objectAtIndex:[indexPath row]];

    NSString *key = [[[a objectAtIndex:0] allKeys] objectAtIndex:0];
    NSString *value = [[a objectAtIndex:0] valueForKey:key];

    static NSString *CellIdentifier = @"MasterCell";

    UsersTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    // If cell does not exist, create it, otherwise customize existing cell for this row
    if (cell == nil) {
        // Create cell
        cell = [[UsersTableViewCell alloc] initWithCoder:<#(NSCoder *)#>reuseIdentifier:CellIdentifier];

        // Configure cell:
        NSLog(@"Key: %@   %d, %d", key, [indexPath section], [indexPath row]);
        // Prepare the date field to move left for checkmark or ex-mark

        if ([key isEqualToString:@"Date"]) {
            CGRect frame = cell.comboLabel.frame;
            frame.origin.x -= 50;
            cell.comboLabel.frame = frame;
            NSLog(@"In Date...  minus 50");
        }
    }

    // Customize cell:
    CGRect frame = cell.comboLabel.frame;
    if ([key isEqualToString:@"Date"]) {
        frame.origin.x -= 50;
        cell.comboLabel.frame = frame;
        NSLog(@"   %d, %d\n   cell: %@\n", [indexPath section], [indexPath row], cell);
    }
    else {
        frame.origin.x += 0;
        cell.comboLabel.frame = frame;
    }

    // Reset color
    cell.comboLabel.textColor = [UIColor blackColor];

    // Set the Item
    cell.nameLabel.text = [NSString stringWithFormat: @" %@",key];
    // Give the cell an accessory indicator
    ..... continue on with logic.
  • 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-01T20:29:54+00:00Added an answer on June 1, 2026 at 8:29 pm

    cell is not nil because you just assigned it to a reusable cell right before the if statement.

    I would consider making a secondary prototype cell with an identifier like “Date Cell” and make a second set of reusable cells if the cell you are creating has key “Date”

    here:

    NSArray *a = [[userDetailData objectAtIndex:[indexPath section]] objectAtIndex:[indexPath row]];
    
    NSString *key = [[[a objectAtIndex:0] allKeys] objectAtIndex:0];
    NSString *value = [[a objectAtIndex:0] valueForKey:key];
    
    static NSString *CellIdentifier = @"MasterCell";
    static NSString *DateCellIdentifier = @"Date Cell";
    
    UsersTableViewCell *cell;
    
    //Customize Cell
    
    if ([key isEqualToString:@"Date"]) {
    
        cell = [tableView dequeueReusableCellWithIdentifier:DateCellIdentifier];
        CGRect frame = cell.comboLabel.frame;
    
        frame.origin.x -= 50;
        cell.comboLabel.frame = frame;
        NSLog(@"   %d, %d\n   cell: %@\n", [indexPath section], [indexPath row], cell);
    }
    else {
        cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        frame.origin.x += 0;
        cell.comboLabel.frame = frame;
    }
    
    // Reset color
    cell.comboLabel.textColor = [UIColor blackColor];
    
    // Set the Item
    cell.nameLabel.text = [NSString stringWithFormat: @" %@",key];
    // Give the cell an accessory indicator
    ..... continue on with logic.
    

    In fact, you probably won’t even need to do most of the customization of the cell if you just customize your prototype cell on the storyboard.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.