Custom UITableViewCell Created in StoryBoard Results in duplicated UILabels

I have been through many questions on SO before asking this.

I have an issue where i have created a custom UITableView cell in a StoryBoard. I have subclassed UITableViewCell and exposed properties to link my various components to within the cell.

I am NOT creating or adding any components to the cell in

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

I simply use the

[tableView dequeueReusableCellWithIdentifier:cleanseCell forIndexPath: indexPath];

call to reuse cells. I do some customisation on the cells but I don't add anything new. I just modify an image, some labels and a text field . The cell reuse identifier is set correctly both in the code and on the component in the storyboard.

The problem is that when the cell is reused, somewhere under the hood the UILabels are being duplicated. I have a UITextField in there as well - it doesn't have this problem. Only the UILabels are somehow duplicated.

So the cell presents fine the first time with the correct information. Then the next time the cell is created its still fine. The third time the cell shows up with Overlapping UILabels. One with the new text and one with the text of the original cell. At any rate there are two UILabels in the cell now where there was only one before and I didn't add it there.

Anyone else experienced this or have some comment to make?


This is my UITableViewCell - There is nothing in the implementation other than synthesising the properties (which is not even required anyway)

#import <UIKit/UIKit.h>

@interface SJCleanseNotificationCell : UITableViewCell
@property (nonatomic)float openHeight;
@property (nonatomic, strong)IBOutlet UIImageView *iconView;
@property (nonatomic, strong)IBOutlet UILabel *dateTimeLabel;
@property (nonatomic, strong)IBOutlet UILabel *titleLabel;
@property (nonatomic, strong)IBOutlet UITextView *messageLabel;

And this is the cellForRowAtIndexPath:

- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    static NSString *cleanseCell = @"CleanseCell";

    NSDictionary *cleanse = sjTimer.cleanseNotification;

    SJCleanseNotificationCell *cell;
    if([_tableView respondsToSelector:@selector(dequeueReusableCellWithIdentifier:forIndexPath:)])
        cell = (SJCleanseNotificationCell*)[_tableView dequeueReusableCellWithIdentifier:cleanseCell forIndexPath: indexPath];
        cell = (SJCleanseNotificationCell*)[_tableView dequeueReusableCellWithIdentifier:cleanseCell];

    [cell.dateTimeLabel setText:[cleanse objectForKey:@"date"]];
    [cell.titleLabel setText:[cleanse objectForKey:@"title"]];
    [cell.messageLabel setText:[cleanse objectForKey:@"message"]];
    NSNumber *stage = (NSNumber*)[cleanse objectForKey:@"stage"];
       [cell.iconView setImage:[[SJCleanseTimer instance]bottleImageForCleanseStage:stage.integerValue]];
    cell.delegate = self;
    cell.openHeight = 100;
    return cell;


The problem was I had Clears Graphics Context unchecked in the inspector on the UILabel elements. After checking that checkbox it behaved normally.

Need Your Help

Using a trigger to implement a foreign key check constraint

oracle plsql triggers foreign-keys

I'm trying to implement this constraint into my database:

Redirect std*** from C++ to Java for Logging

java c++ ipc pipe

I have a C++ application and a Java application that need to log messages in the same way. My Java application uses Apache Commons Logging, backed by a Log4j configuration. I need a single log4j

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.