I ran the tools for my application (which contains a UITableView) and got the following results
The cell will call the [UICustomButton SetButtonWithAnswer ....] method every time the cell becomes visible
EDIT: added more screenshots





The problem is that I'm not sure what exactly is causing the leak. I released all my inits values in code. Why is it still leaking?
Any advice on this would be greatly appreciated!
EDIT:
I added UICustom Buttons as follows
if (cell == nil)
{
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:PlaceholderCellIdentifier] autorelease];
UICustomButton *likeButton = [[UICustomButton alloc]init];
likeButton.tag = 7;
UICustomButton *commentButton = [[UICustomButton alloc]init];
commentButton.tag = 8;
UICustomButton *answerButton = [[UICustomButton alloc]init];
answerButton.tag = 9;
[self.contentView addSubview:likeButton];
[self.contentView addSubview:commentButton];
[self.contentView addSubview:answerButton];
[likeButton release];
[commentButton release];
[answerButton release];
}
UICustomButton *thisLikeButton = (UICustomButton *)[self.contentView viewWithTag:7];
[thisLikeButton setButtonWithAnswer:self.answerForCell buttonType:@"like" navcon:self.navcon andFrame:CGRectMake(CELL_TEXT_LEFT_MARGIN, totalCommentLabelHeight + CELL_SPACING*4, 45, CELL_BUTTON_HEIGHT)];
thisLikeButton.imageView.image = [UIImage imageNamed:@"heart.png"];
UICustomButton *thisCommentButton = (UICustomButton *)[self.contentView viewWithTag:8];
[thisCommentButton setButtonWithAnswer:self.answerForCell buttonType:@"comment" navcon:self.navcon andFrame:CGRectMake(CELL_TEXT_LEFT_MARGIN + 45 + 5, totalCommentLabelHeight + CELL_SPACING*4, 80, CELL_BUTTON_HEIGHT)];
thisCommentButton.imageView.image = [UIImage imageNamed:@"chat.png"];
UICustomButton *thisAnswerButton = (UICustomButton *)[self.contentView viewWithTag:9];
[thisAnswerButton setButtonWithAnswer:self.answerForCell buttonType:@"join in" navcon:self.navcon andFrame:CGRectMake(1.5*CELL_TEXT_LEFT_MARGIN + 45 + 5 + 80 + 5, totalCommentLabelHeight + CELL_SPACING*4, 60, CELL_BUTTON_HEIGHT)];
thisAnswerButton.imageView.image = [UIImage imageNamed:@"beer-mug_white.png"];
source
share