当然是。只需替换整个附件视图
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
// setup cell
UIImageView *aView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]] autorelease];
cell.accessoryView = aView;
return cell;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
// setup cell
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0, 0, 44, 44);
[button setImage:[UIImage imageNamed:@"SettingsIcon.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(accessoryButton:withEvent:) forControlEvents:UIControlEventTouchUpInside];
cell.accessoryView = button;
return cell;
}
- (void)accessoryButton:(UIControl*)button withEvent:(UIEvent *)event {
UITableView *tv = (UITableView*)[[button superview] superview];
UITableViewCell *cell = (UITableViewCell*)[button superview];
NSIndexPath *ip = [tv indexPathForCell:cell];
[tv.delegate tableView:tv accessoryButtonTappedForRowWithIndexPath:ip];
}