views:

103

answers:

1

I am new to iphone development.I am displaying a xml parsed contents in a grouped tableView.I want disable the click event on it(i should not be able to click it at all) .Since it is grouped table , it contains two tables and i want to disable the first table only and not the second table.How can i achieve it?Please help me out.Thanks.

+1  A: 

If you don't want the user to be able to click on a table view, just use this code:

- (NSIndexPath *)tableView:(UITableView *)tableView
  willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}
nevan
Thanks , its working.Since it is grouped table , it contains two tables and i want to disable the first table only and not the second table.How can i do that?
Warrior
A grouped table is still only one table. Look at the `indexPath` variable which gets passed, it should tell you which section was clicked (along with the row). Put in an if statement to return nil for the section you don't want selected. For the other one, return `indexPath` as is.
nevan
thanks, i got it.
Warrior