現在、plist を使用してテーブル ビューの行 (つまり、名前、説明、画像) を設定しています。ユーザーが行を選択すると、行のイメージを全画面表示する imageView で新しいコントローラーがプッシュアップされます。
私が直面している問題は、文字列を新しいviewControllerのimageViewに渡すことです。
すべての NSLog は正しい情報を返しますが、UIImageView をログに記録すると null が返されます。正しく接続していませんか?行は、選択されるまで画像を表示しません (基本的に、行はサムネイルのように機能しています)。
どんな助けでも大歓迎ですありがとう!!!
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *childDictionary = [mainChildren objectAtIndex:indexPath.row];
//Image Name NSString from plist
childImage = [childDictionary objectForKey:@"Child Image"];
if ([childDictionary objectForKey:@"Child Image"] == nil) {
NSLog(@"No Image String Found.");
}
else {
NSLog(@"Image String Found. Image Name is: %@", childImage);
UIImage *myImage = [UIImage imageNamed:childImage];
NSLog(@"Image Found. Image is: %@", myImage);
UIImageView *childImageView = [childImageView setImage:myImage];
NSLog(@"ImageView Found. ImageView is: %@", childImageView);
FullscreenImageViewController *imgViewer = [[FullscreenImageViewController alloc] init];
imgViewer.fullScreenImageView = childImageView;
[self presentViewController:imgViewer animated:YES completion:nil];
}
}