IOS 6中的SLRequest

Kis*_*der 4 facebook ios6

如何使用SLRequestUIImage附加到Facebook上的帖子.这是我的代码:

SLRequest *facebookRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
                                                                 requestMethod:SLRequestMethodPOST
                                                                      URL:[NSURL   URLWithString:@"https://graph.facebook.com/me/feed"]
                                                               parameters:[NSDictionary dictionaryWithObject:post forKey:@"message"]];
Run Code Online (Sandbox Code Playgroud)

我知道有必要在参数中指定图片,但我不知道它要做什么.

C A*_*thy 6

将图像添加为多数据并使用名称"picture".

UIImage *myImage = [UIImage imageNamed:@"test.png"];
NSData *myImageData = UIImagePNGRepresentation(myImage);
[facebookRequest addMultipartData:myImageData withName:@"picture" type:@"image/png" filename:nil];
Run Code Online (Sandbox Code Playgroud)