如何从fbprofilepictureview检索图像并将此图像存储到数据库中

显示个人资料图片。

self.userProfileImage.profileID = user.id; 

  for (NSObject *obj in [userProfileImage subviews]) { if ([obj isMemberOfClass:[UIImageView class]]) { UIImageView *objImg = (UIImageView *)obj; img_ProfilePictureImg.image = objImg.image; break; } } img_ProfilePictureImg.image=[UIImage imageWithContentsOfFile:profileImage]; 

我没有得到— fbprofilepicture

  UIImage *img_Profile = --------.imageView.image; // How to get that image view NSData *dataOfProfilePic = UIImagePNGRepresentation(img_Profile); 

https://graph.facebook.com/username/picture?redirect=true

使用此url,您可以获得个人资料照片。

在Facebook委托loginViewFetchedUserInfo您可以获取用户个人资料照片的图像url

  - (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id)user { NSString *imageUrl=[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?redirect=true", user.username]; }