我正在使用 FB SDK 并在我的视图中从我的应用程序上传 FB 帖子上的图片时出现错误,我确实加载了我拥有的 UIImageView,它有一个我需要在 FB 上发布的图像,视图的代码确实加载了
ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 65, 65)];
ImageView.center = CGPointMake(42, 43);
[View addSubview:ImageView];
在我的 FB post 方法中,我做到了
UIImage *image = [[UIImage alloc]init];
image = ImageView.image;
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:3];
[params setObject:@"LINK_HERE" forKey:@"link"];
// due to this line below, i am getting an error :
// "[UIImage length]: unrecognized selector sent to instance 0x170fa0e0"
// and if use http link instead of image(UIImage) it works, but i want to use my image
[params setObject:image forKey:@"picture"];
[params setObject:@"NAME_HERE" forKey:@"name"];
[params setObject:@"DEC_HERE" forKey:@"description"];
// Invoke the dialog
[self.facebook dialog:@"feed" andParams:params andDelegate:self];
我应该如何在这段代码中使用我的 UIImage ......任何想法?