मेरे पास UITableViewController
है जहां उपयोगकर्ता आइटम को संपादित करने में सक्षम होना चाहिए।संपादन करते समय, 'UITableView` को कॉल नहीं किया जाता है SelectRowAtIndexPath ??
self.navigationItem.rightBarButtonItem = self.editButtonItem;
हर किसी के लिए जो पता नहीं है जहां self.editButtonItem से आता है, यह एसडीके द्वारा पूर्वनिर्धारित है: आदेश संपादन सक्षम करने के लिए मैं इस का उपयोग करें।
तो, अब जब मैं किसी भी आइटम पर दबाते हैं, तो इस विधि कहा जाता है:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
लेकिन जैसे ही मैं संपादित करें बटन हिट और संपादित करते समय सक्रिय है, इस विधि के नाम से जाना लग रहा था नहीं है।
कोई विचार जो मुझे याद आ रहा है?
इस कोड है कि संपादन से संबंधित है के बाकी है:
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
return NO;
}
मदद के लिए धन्यवाद।
एमसीबी
ठीक वही है जो मैं खो रहा था, धन्यवाद – elementsense
जादू उत्तर .. _superTableView.allowsSelectionDuringEditing = true; और _superTableView.allows चयन = सत्य; धन्यवाद!! – Fattie
चार साल बाद, और आप अभी भी जीवन बचा रहे हैं! – thomax