Làm cách nào để xóa hàng UITableView khi vuốt? Tôi biết câu hỏi đã được hỏi, nhưng tôi chỉ nhận được lỗi. Đây là mã:Vuốt để xóa UITableView
-(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
// If row is deleted, remove it from the list.
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSInteger row = [indexPath row];
[tableDataSource removeObjectAtIndex:row];
}
}
Nhưng không có gì xảy ra. Tôi sẽ đánh giá cao nếu bạn viết mã.
OMG! Và điều đó thật dễ dàng! Cảm ơn bạn rất nhiều! – KillaIce
:) Tại sao bạn không chấp nhận câu trả lời? –
Tôi có thể làm điều đó trong 3 phút: ( – KillaIce