我正在尝试从一个表中传递一个数组,并将其填充到另一个表中。父表放在一个UINavigationController
说“ mainNavig ”上。子表放在另一个ViewController
名为“ SongsofAlbum ”的表中。我didSelectRowAtIndexPath
的父表如下,
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
albumName = [eliminateDupe objectAtIndex:indexPath.row];
temp = [dictforalbum allKeysForObject:albumName ];
songs = [NSMutableArray arrayWithCapacity:[temp count]];
for (NSString *filename in temp) {
[songs addObject:[[filename lastPathComponent] stringByDeletingPathExtension]];
}
NSLog(@"songs are %@",songs);
songObj = [[SongsofAlbum alloc]initWithNibName:@"SongsofAlbum" bundle:nil];
[mainNavig pushViewController:songObj animated:YES];
songObj.albumname = albumName;
songObj.songArray = songs;
NSLog(@"the song object array is %@ ",songObj.songArray)
}
songObj.songArray 的 nslog 返回上述方法中的数据。但我面临的问题是,当我在子视图控制器中调用此 songArray 时,它返回 NULL 。我什至对这些数组进行了属性合成。有什么建议么?