Button doesn't respond in viewForRow:
UIView * rowView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 44)] autorelease];
UIButton* deleteButton = [[[UIButton alloc]init]autorelease];
deleteButton.frame = CGRectMake(200, 10, 20,20);
[deleteButton setImage:[UIImage imageNamed:@"IconTrash.png"] forState: UIControlStateNormal];
[deleteButton addTarget: self action:@selector(removeCellAtIndexPath:) forControlEvents: UIControlEventTouchUpInside];
UILabel *labelText = [[UILabel alloc]init];
labelText.text = [NSString stringWithFormat:@"%@",[[localFlagNotes objectAtIndex:row] value]];
labelText.font = [UIFont fontWithName:@"Arial" size: 24];
labelText.frame = CGRectMake(0, 10, 200, 28);
labelText.backgroundColor = [UIColor clearColor];
[rowView addSubview:labelText];
[rowView addSubview:deleteButton];
[labelText release];
return rowView;
removeCellAtIndexPath
doesn't call after press button. Does anyone have some idea why and some solution?
I think button even not pressed only cell become active.
I find ways. just in
Create custom View with button
Like this
}
And use:
Or: