gpt4 book ai didi

objective-c - 使用UIImage作为@“picture”共享Facebook对话框

转载 作者:行者123 更新时间:2023-12-01 18:00:07 25 4
gpt4 key购买 nike

这是简单的代码

UIImage *ScreenShot = [self getScreenshot];

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Name", @"name",
@"Caption.", @"caption",
@"Description.", @"description",
@"www.example.com", @"link",
ScreenShot, @"picture",
nil];

[ facebook dialog:@"feed"
andParams:params
andDelegate:self];

当我编译它时收到此消息
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage length]: unrecognized selector sent to instance 0x1288bb90' *** First throw call stack:

最佳答案

您无法将图像直接上传到墙上,而在发布到墙上时,您只能将图像链接到墙上。
因此,您需要先将UIImage上传到某个地方。您有2个选择:

  • 上传到您的/某些服务器并发布链接到该服务器的墙贴。
  • 上传到Facebook相册。检查有关此操作的graph API,这很简单
  • 关于objective-c - 使用UIImage作为@“picture”共享Facebook对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11070398/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com