我有一个来自我的核心数据的所有实体的列表视图。
点击时,它应该将所选实体的值推送到即将被推送到导航堆栈的视图中的文本字段中,但事实并非如此。
让我感到困惑和恼火的是,如果我NSLog
使用textFields
. 标题也发生了应有的变化,这让我很困惑为什么文本字段没有。我错过了什么吗?我是否错误地访问了 Athlete 实体?
这是我的代码片段(注意Athlete.h
是动态创建核心数据属性,是AllAthletes.h
被推送的详细视图)table view
AthleteDetail.h
allathletes.h
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
Athlete *athlete = (Athlete *)[athleteArray objectAtIndex:indexPath.row];
AthleteDetail *athleteDetail= [self.storyboard instantiateViewControllerWithIdentifier:@"showAthlete"];
athleteDetail.firstDetailTextField.text = athlete.first;
athleteDetail.title = athlete.full;
NSLog(@"Full Name: %@",athlete.full);
NSLog(@"Parent's Full Name: %@", athlete.pfull);
NSLog(@"Number: %@",athlete.phone);
NSString *firstNameText = athleteDetail.firstDetailTextField.text;
firstNameText = [NSString stringWithFormat:@"%@",athlete.first];
[self.navigationController pushViewController:athleteDetail animated:YES];
}