我正在测试在执行segue之前是否设置了标志。我记录输出,所选对象为零,我不明白为什么。我可以在cellForRowAtIndexPath
它可能显而易见但我无法看到它......
代码就是这样:
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
NSLog(@"%s", __FUNCTION__);
NSIndexPath *indexPath = [self.searchDisplayController.searchResultsTableView indexPathForCell:(UITableViewCell *)sender];
id object;
if (indexPath != nil)
{
object = [self.searchResults objectAtIndex:indexPath.row];
[self.searchDisplayController setActive:NO];
}
else
{
indexPath = [self.objectTable indexPathForCell:(UITableViewCell *)sender];
object = [self.fetchedResultsController objectAtIndexPath:indexPath];
}
NSLog(@"object is: %@", object);
欢迎任何想法..如果您需要更多代码,请询问。