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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:28:52+00:00 2026-05-28T02:28:52+00:00

I created a UITableViewCell in Xcode 4 using IB. But for some weird reason

  • 0

I created a UITableViewCell in Xcode 4 using IB. But for some weird reason when I trigger my edit button, the cell acts really weird and doesn’t have the same animations as a normal table view cell. I don’t know what is happening, I tried implementing -(void)setEditing:(BOOL)editing animated:(BOOL)animated in my custom cell class but still nothing works.

UPDATE: My ViewController that I am using the cell in, has this code under cellForAtIndex to display the cell.

CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell == nil)
    {
    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:nil options:nil];
    for (id currentObject in topLevelObjects) 
    {
        if ([currentObject isKindOfClass:[UITableViewCell class]]) 
        {
            cell = (CustomCell *) currentObject;
            break;
        }
        return cell;
    }
}

Normal view:

The normal view

When tapping edit button:

enter image description here

edit

And even when swiping it covers the text when it’s supposed to move it aside:

enter image description here

  • 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-28T02:28:53+00:00Added an answer on May 28, 2026 at 2:28 am

    First suggestion; don’t use IB for custom UITableViewCells.

    Next; make sure you’re adding any custom views to the UITableViewCell‘s contentView… not just the cell itself. When the editing portions are shown (like the delete button) the UITableViewCell‘s contentView will shrink automatically. If you have the correct UIViewAutoresizing mask on the UILabel / whatever you’ve added to the contentView, it will get resized / moved correctly.

    Edit, to answer your question in comments:

    The same way you would any custom view. You could make it a class on it’s own, or, depending on your needs, construct it ad-hoc. A class is usually best so you can reference any of your custom things you’ve added to the cell and reuse cells / etc.

    But, here’s is an example of constructing one ad-hoc.

    UIImageView * myCheckBox = ...
    UILabel * myLabel = ...
    UITableViewCell * cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    [cell.contentView addSubview:myCheckBox];
    [cell.contentView addSubview:myLabel];
    self.customCell = cell;
    

    Edit #2

    - (void)layoutSubviews
    {
        [super layoutSubviews];
        self.textLabel.frame = CGRectMake(50, self.textLabel.frame.origin.y, self.contentView.frame.size.width - 50, self.textLabel.frame.size.height);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom UITableViewCell , but when I dequeue the cell, sometimes
I've created a custom cell class using these instructions: http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/ Everything worked great, except
I have created a UITableViewCell using UITableViewCellStyleValue1, which the Apple docs define as: A
I created a custom UItableviewcell added a button into its initWithStyle area: favoriteButton =
I've used following function in some of my projects, but recently I've created a
I converted my old UITableViewCell from being programmatically created to using Interface Builder and
I am showing comments in UItableView and created delete button in Cell..When I delete
I have UItableViewCell created with a nib file, and have put in my cell
I created UIButtons in UITableViewCell. It is displaying properly in iphone. But when I
I've created a custom UITableViewCell but am having trouble updating the contents of the

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.