Sorry, I hadn't visited this thread for a while. I'm doubting you still have this problem since it's been 2.5 months!
But, just in case you still care...
Quote:
Originally Posted by rashdan
if the Switch is off and I disable the selection, how can I turn the Switch ON if the row selection is disabled.
|
I should have been more clear: DON'T disable selection via cell.userInteractionEnabled = NO. As you are observing, that turns off the whole cell, including the switch.
So, I'm on a PC at the office and don't have easy access to documentation/code. But, just like you define
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
you can also define
Code:
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
within that (optional delegate) method, you check the value of your switch and decide whether the switch is ON or OFF and either return indexPath or nil.