코어 데이터를 사용하고 있으며 obj-c의 루키입니다. 내 핵심 데이터에서 "위도"와 "경도"를 mapViewController
으로 전달하려고합니다.데이터를 uitableviewcell to destinationviewcontroller에 전달할 수 없습니다.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"ShowMap"]) {
HaritaVC *destViewController = segue.destinationViewController;
NSIndexPath *path = [self.myTableView indexPathForSelectedRow];
NSString *lattoPass = [NSString stringWithString:[[self.fetchedRecordsArray objectAtIndex:path.row]objectForKey:@"lat"]];
NSString *lontoPass = [NSString stringWithString:[[self.fetchedRecordsArray objectAtIndex:path.row]objectForKey:@"lon"]];
destViewController.latt = [[NSString alloc] initWithFormat:@"%@",lattoPass];
destViewController.lonn = [[NSString alloc] initWithFormat:@"%@",lontoPass];
}
}
내 "의 tableview"코드 :
코드'NSInvalidArgumentException', reason: '-[Notlar objectForKey:]: unrecognized selector sent to instance 0x1aa56b60'
'Notlar'란 무엇입니까? – Larme
당신의'didSelectRowAtIndexpath'를 보여주세요 – Templar
당신의 반환 값처럼 보입니다 fetchedRecordArray는 Notlar 객체의 인스턴스가 아닙니다. 코드를 단계별로 실행하고 반환 된 객체를 인쇄하여 그것이 무엇인지 알 수 있습니다. 그것은 가치가 없습니까? –