views:

34

answers:

2

Hello , is there a way to set the allowsSelection property of UITableView for each table section separately, and not for the whole table ?

Thanks in advance

+1  A: 

Doesn't look like it. Here's what you do: use the indexPath.section value to set the cell's .selectionStyle to UITableViewCellSelectionStyleNone and to return early from -didSelectRowAtIndexPath.

In other words, you'll configure cells in certain sectinos to not flash blue when selected, and when it IS selected, not to do anything. It'll be just as if that section had its allowsSelection property set to NO.

Dan Ray
Thank you . Unorthodox workaround but it worked :)
Kostas.N
+1  A: 

Try using the willSelectRowAtIndexPath method and return nil for the section you don't want to allow selection on.

Padawan