如何使用slRequest
将图像发布到Facebook用户墙?
-(IBAction)done
{
NSString *message=@"hello";
NSString *picture=[[NSBundle mainBundle]pathForResource:@"4" ofType:@"jpg"];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:message, @"message",picture,@"picture", nil];
}
答案 0 :(得分: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];
答案 1 :(得分:0)
试试这个,使用@"source"
密钥发布图片
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:_image, @"source",msg,@"name",nil];
//_image is UIImage