У меня в ячейке таблицы есть распознаватель пролистывания
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
//swipe recognition
UISwipeGestureRecognizer *g = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(cellWasSwiped:)];
[cell addGestureRecognizer:g];
[g release];
}
// Configure the cell...
[[cell textLabel] setText:[NSString stringWithFormat:@" number %d", indexPath.row]];
return cell;
}
и функция смахивания
- (void)cellWasSwiped:(UIGestureRecognizer *)g {
NSLog(@"sunt in cellWasSwiped");
swipeViewController *svc = [[swipeViewController alloc]init];
[self.navigationController pushViewController:svc animated:YES];
[svc release];
}
и, введя точки останова, я вижу, что моя функция считывания вызывается 2 раза, и на моем контроллере навигации установлены два идентичных контроллера вида. Почему моя функция смахивания вызывается дважды, когда я смахиваю ячейку?