I have three sections in my hypothetical UITableView. I'd like one section that is in editing mode. The rest of the sections to not be in editing mode. Is this possible at all?
+7
A:
This really shouldn't be a mystery, as it's spelled out clearly in the documentation. Simply use the datasource method
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
August
2009-02-24 03:29:16
Thanks - I was just looking for this myself and it was much easier to find it here than in the docs :-)
Phil Nash
2009-05-10 18:57:47
jamone
2010-02-23 16:56:48
You must have an object that you have appointed as the table view's data source. In the class for that object, write the instance method that August presented the signature for. It must have that exact signature. The table view will send your data source object that message to ask whether the user should be allowed to edit that row. Return `YES` when it asks you about the row that you want to allow editing for; return `NO` when it asks you about any other row. For more info, see the docs: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDataSource_Protocol/
Peter Hosey
2010-02-23 16:55:57
Furthermore, when you want to ask a question, you should ask it as a question, not as an answer on another question, which is what you've done here.
Peter Hosey
2010-02-23 16:56:31