我使用SDWebImage将我的TableViewCell中的图像传递给我的Detail View Controller中的UIImageView。出于某种原因,我的DetailViewController中的这一行给我一个错误:" NSDictionary没有可见的@interface声明了选择器sd_setImageWithURL"。我已经添加了适当的" UIImageView + WebCache.h"我的TableViewController和DetailViewController,所以我不确定为什么会这样;帮助!
TableViewController.m
FullArticleViewController *detailViewController = [[FullArticleViewController alloc]
initWithNibName:@"FullArticleViewController" bundle:nil];
detailViewController.title = [[Doctors objectAtIndex:indexPath.row] objectForKey:@"node_title"];
detailViewController.articleDetail = [Doctors objectAtIndex:indexPath.row];
[detailViewController.featureImage sd_setImageWithURL:[NSURL URLWithString:cellImageLink]];
NSLog(@"cellImageLink is %@", cellImageLink);
[self.navigationController pushViewController:detailViewController animated:YES];
DetailViewController.h
{
IBOutlet UIScrollView *scroller;
IBOutlet UILabel *firstnameLabel;
IBOutlet UILabel *descriptionLabel;
IBOutlet UILabel *bodyLabel;
IBOutlet UIImageView *featureImage;
}
@property (nonatomic, copy) NSDictionary *articleDetail;
@property (strong, nonatomic) UIImageView *featureImage;
@property (strong, nonatomic) NSString *cellImageLink;
DetailViewController.m
featureImage.image = [UIImageView setImageWithURL:[NSURL URLWithString:cellImageLink]];
NSLog(@"cellImageLink is %@", cellImageLink);