尝试从搜索结果推送到新 View ,但由于某种原因代码未被调用。抱歉,我无法描述得更清楚。
代码如下:
-(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;
}
}
谢谢
最佳答案
首先检查tableview的datasource和delegat。
删除 [self.table deselectRowAtIndexPath:indexPath animated:YES];
并检查一次。
关于iphone - 从 UISearchDisplayController 推送到新 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16167488/