所以我有一个Facebook 好友的UITableView,对于一个单元格,我想将图像添加到其中。
当我尝试以下代码时:
cell.imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString: (@"http://graph.facebook.com/shaverm/picture")]]];
一切正常。虽然这是对图像目标的硬编码,但是当我做这样的事情时:
cell.imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString: (@"http://graph.facebook.com/%@/picture", thisFriend.friendID)]]];
它给我一个警告,指出“未使用表达式结果”,同时指向链接前的 @ 符号。
任何想法为什么会发生这种情况?
我也试过:
cell.imageView.image = [UIImage imageNamed:thisFriend.friendPhoto];
但这给了我一个“不兼容的指针类型将 UIImage 发送到 NSString 类型的参数”警告。