1

试图从搜索结果中推送到新视图,并且由于某种原因没有调用代码。抱歉,我不能更详细地描述。

这是代码:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[self.table deselectRowAtIndexPath:indexPath animated:YES];
int selectedTemplateID = [((CollectionItem*)[cllct objectAtIndex:indexPath.row]).tID intValue];

ACollection *newView = [[ACollection alloc] initWithID:selectedTemplateID];
newView.template = [cllct objectAtIndex:indexPath.row];

if(tableView == self.table) {
    [self.navigationController pushViewController:newView animated:YES];
    newView.theTitle = [self.table cellForRowAtIndexPath:indexPath].textLabel.text;
}
if(tableView == self.searchDisplayController.searchResultsTableView) {
    NSLog(@"Should push");
    [self.navigationController pushViewController:newView animated:YES];
    newView.theTitle = [self.table cellForRowAtIndexPath:indexPath].textLabel.text;
  }

}

谢谢

4

1 回答 1

-1

首先检查tableview的数据源和委托。删除[self.table deselectRowAtIndexPath:indexPath animated:YES];并检查一次。

于 2013-04-23T11:05:27.507 回答