我有一个非常简单的代码很大的问题。 我需要从Facebook URL获取图片并将其放在UIImageView上。从网络获取图像到UIImageView不起作用
我不知道但不工作。 我也试过不同的链接(没有Facebook的链接也不工作)。
-(IBAction)setUserPhoto:(id)sender{
NSURL *url = [url initWithString:@"http://graph.facebook.com/100000769380612/picture?type=large"];
NSData *imageData = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:imageData];
if(image){
NSLog(@"Image OK");
} else if (!image) {
NSLog(@"Error");
}
[userPhoto setImage:image];
}
谢谢。
不,我改变了它。还有其他问题。 – Byteros 2012-03-22 12:43:52
我刚刚编辑我的答案,请尝试它,它对我的工作很好 – Raj 2012-03-22 12:48:40
Woooow。是工作。谢谢Rajesh。 – Byteros 2012-03-23 11:07:38