I have a UITableView where every cell either gets/loses a checkbox or goes to another table view when clicked. For every table, I want to add a check all button that checks off every cell in that table and all the ones inside it. How do I allow one UITableViewCell to toggle the checkbox of every one in it's TableView?
EDIT: Removing the last index in the index path, and replacing it by the new row number, I'm able to go through the entire table and check it off, like this:
for(int i = 0; i < [tableView numberOfRowsInSection:0]; i++){
UITableViewCell *newCell = [tableView cellForRowAtIndexPath:[[indexPath indexPathByRemovingLastIndex]
indexPathByAddingIndex: i]];
newCell.accessoryType = UITableViewCellAccessoryNone;
}
Oddly, it skips over every tenth cell or so - and it's not even consistent. For a list of years, sometimes it doesn't check off 2003 and 1993, sometimes 2003 and 1991, and and so on. It's always around every tenth cell or so, but I can't find a pattern.