IPhone encoding: problem with choosing UITableView

I have a strange problem with my UITableView. I want all the cells in the table to be selected, so that if a cell is selected, the corresponding action is performed. All cells of my table are currently selected separately from the cell in row 0 (the cell located at the top of the table). This cell cannot be selected, even if it is configured to select. Any ideas?




- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { tableView.allowsSelection = YES; static NSString *SettingsTableID = @"SettingsTableID"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SettingsTableID]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier: SettingsTableID] autorelease]; } cell.textLabel.text = [tableHeadingsArray objectAtIndex:row]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; 

}




Thank you very much.

0
iphone uitableview
Dec 01 '10 at 17:12
source share
1 answer

Sorry everyone, I'm stupid. :) This code was in my ViewController subclass. I copied the class from the example and forgot to test it completely before using it.

 -(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSUInteger row = [indexPath row]; if (row == 0) return nil; return indexPath; 

}

Removing this issue fixed the issue.

Greetings.

0
Dec 01 '10 at 17:55
source share



All Articles