如何将UIImage附加到Facebook上的帖子上,使用SLRequest。这是我的密码:
SLRequest *facebookRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodPOST
URL:[NSURL URLWithString:@"https://graph.facebook.com/me/feed"]
parameters:[NSDictionary dictionaryWithObject:post forKey:@"message"]];我知道有必要在参数中指定图片,但我不知道如何制作。
发布于 2012-10-20 14:01:38
将图像添加为多个数据,并命名为“图片”。
UIImage *myImage = [UIImage imageNamed:@"test.png"];
NSData *myImageData = UIImagePNGRepresentation(myImage);
[facebookRequest addMultipartData:myImageData withName:@"picture" type:@"image/png" filename:nil];https://stackoverflow.com/questions/12958723
复制相似问题