答案 0 :(得分:0)
我假设您知道要选择的索引?
有点不清楚找到正确的groups
否则你需要一个for循环来在fetchedResults中找到它
// for loop around _group to find the index
NSInteger index = -1;
for (NSInteger i = 0; i < [_group count]; i++) {
NSManagedObject *groups = [_group objectAtIndex:i];
if (selectedgroup != nil && groups == selectedgroup) {
index = i;
break;
}
}
if (index != -1)
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop];
我还假设您只有1个部分,因为您要为indexPath.row拉出托管对象