के लिए हटाने के लिए स्लाइड को अक्षम करने के लिए कैसे करें क्या कोई जानता है कि uitableview में 'स्लाइड-टू-डिलीट' को अक्षम कैसे करें?UITableView
मैं अभी भी पंक्तियों को हटाने में सक्षम होना चाहता हूं जबकि तालिका संपादन मोड में है।
के लिए हटाने के लिए स्लाइड को अक्षम करने के लिए कैसे करें क्या कोई जानता है कि uitableview में 'स्लाइड-टू-डिलीट' को अक्षम कैसे करें?UITableView
मैं अभी भी पंक्तियों को हटाने में सक्षम होना चाहता हूं जबकि तालिका संपादन मोड में है।
मेरा है:
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return self.editing ;
}
सबसे पहले, यह पुष्टि करने के लिए कि कोई तालिका सेल हटाया जा सकता है, बस canEditRowAtIndexPath को उत्तर दें।
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return YES or NO
return(YES);
}
}
फिर, वास्तव में प्रतिबद्ध करने के लिए टेबल सेल जवाब को हटाने के लिए।
-(void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete your data
// Delete the table cell
[self.tableView deleteRowAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
शुभकामनाएँ मैट Stijlaart!
आप कभी भी अपने अन्य सवालों के जवाब को छोड़कर पर विचार किया? – Eiko