0

如何使用slRequestFacebook 用户墙发布图像?

-(IBAction)done
{
    NSString *message=@"hello";

    NSString *picture=[[NSBundle mainBundle]pathForResource:@"4" ofType:@"jpg"];

    NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:message, @"message",picture,@"picture", nil];
}
4

2 回答 2

0

尝试使用这个,你知道你从 NSBundle 获取路径而不是图像,所以你需要从图片路径获取第一张图像,然后执行它。

NSString *picture=[[NSBundle mainBundle]pathForResource:@"4" ofType:@"jpg"];
 UIImage *image = [UIImage imageWithContentsOfFile:picture];

       NSMutableDictionary* params = [[NSMutableDictionary alloc] initWithObjectsAndKeys:message, @"message",image, @"picture",nil];
于 2013-06-04T11:59:00.237 回答
0

试试这个,使用@"source"密钥发布图片

 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:_image, @"source",msg,@"name",nil];
//_image is UIImage
于 2013-06-04T12:08:12.373 回答