i have a little problem. when i enter the edit mode of my uitableview the a manuel added label should disappear. i realized this by setting the alpha of this label开发者_运维知识库-field to 0 in following method:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self isEditing] && [indexPath row] == [tripArray count]) {
return UITableViewCellEditingStyleInsert;
}
[[[[self tableView] cellForRowAtIndexPath:indexPath] detailTextLabel] setAlpha:0];
return UITableViewCellEditingStyleDelete;
}
But in which delegate-methode of my tableview i can set the alpha back to 1, when the edit mode was finished??? hopefully someone has an idea? i didn't find the right one......
Take a look at: tableView:commitEditingStyle:forRowAtIndexPath:
. UITableView
will call this data source method when the user taps on the delete or insert button on a table view cell.
I made a work around and used the standard text labels from the standard cells. this text labels disappear in edit mode... not a nice way, but it did it for me.
精彩评论