Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DrewCH

macrumors newbie
Original poster
Nov 16, 2009
1
0
I'm trying to develop a custom edit mode for a UITableViewCell which basically just enables/disables user interactivity with the UITableViewCell objects. I'm running into a problem where after clicking the Edit button, the code for enabling interactivity fires, but the cell does not become interactive until after the Done button is pressed. I discovered this by commenting out the code for disabling interactivity. Without commenting the code out, the cell never becomes interactive because the disabling code runs. Here is the implementation of the custom UITableViewCell:

Code:
#import "FlingdarTableViewCell.h"


@implementation FlingdarTableViewCell


- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
	//[super setEditing:editing animated:animated];
	[self setNeedsLayout];
}

- (void)layoutSubviews
{	
	[super layoutSubviews];
	
	if (((UITableView *)self.superview).isEditing)
	{
		[self setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
		[(FlingdarTableViewCell *)self setUserInteractionEnabled:YES];
	}
	else
	{
		[self setAccessoryType:UITableViewCellAccessoryNone];
		[(FlingdarTableViewCell *)self setUserInteractionEnabled:NO];
	}

}

- (void)dealloc
{
    [super dealloc];
}


@end

Any help would be greatly appreciated. If you need to see any of the other code, I can provide it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.