У меня проблема при выборе строки в таблицеView, проблема в том, что когда я выбираю строку в первый раз, она выделяется серым цветом, но ничего не происходит, и мне нужно снова выбрать строку для выполнения "didSelectRowAtIndexPath" и берет меня к другой ViewControllerСтрока выбора на tableView iOS
// Number of rows in the tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 6;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 175.0;
}
// Populating each cell at a time.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
ClientCustomCell *cell = (ClientCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"ClientCustomCell" owner:self options:nil];
cell = self.clientCustomCell;
self.clientCustomCell = nil;
cell.name = [nameArray objectAtIndex:indexPath.row];
cell.number = [numberArray objectAtIndex:indexPath.row];
cell.postal = [postalArray objectAtIndex:indexPath.row];
cell.locality = [localityArray objectAtIndex:indexPath.row];
}
[cell setSelectionStyle:(UITableViewCellSelectionStyleBlue)];
return cell;
}
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSLog(@"row selecter %d", (int)indexPath.row);
InfoViewController *info = [[InfoViewController alloc] init];
[self.navigationController pushViewController:info animated:YES];
}
replace - (void) tableView: (UITableView *) tableView didDeselectRowAtIndexPath: (NSIndexPath *) indexPath с - (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath – hariszaman