- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试使用以下代码使用 iOS SDK 发布开放图操作:
[FBRequestConnection startForUploadStagingResourceWithImage:image completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error){
NSString *uri = [result valueForKey:@"uri"];
NSMutableDictionary<FBOpenGraphObject> *object = [FBGraphObject openGraphObjectForPost];
object.provisionedForPost = YES;
object[@"type"] = @"myapp:Quote";
object[@"image"] = uri;
object[@"title"] = @"Check out my quote";
[FBRequestConnection startForPostOpenGraphObject:object
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if(error) {
NSLog(@"Error: %@", error);
} else {
NSString *graphPath = [NSString stringWithFormat:@"me/quotestagramapp.quote"];
[FBRequestConnection startForPostWithGraphPath:graphPath
graphObject:object
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (error){
NSLog(@"Error is %@", [error description]);
} else {
NSLog(@"Successful");
}
}];
}
}];
} else {
NSLog(@"Error uploading image to fb staging");
}
}];
但是我收到一个错误,然后应用程序在我的 startForPostWithOpenGraphPath 中崩溃了。这是错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean dataUsingEncoding:]: unrecognized selector sent to instance 0x3a9be530'
*** First throw call stack:
(0x3261c2a3 0x3a34497f 0x3261fe07 0x3261e531 0x32575f68 0x1e9ac1 0x1e9b8d 0x1eb521 0x1ec639 0x1eca19 0x1eb28d 0x1ea0f9 0x1eac49 0x1e5ca5 0x110ecb 0x1edc11 0x1ece77 0x1eaebf 0x1ef3af 0x1ef2e9 0x1ef923 0x32f576fd 0x32e971f9 0x32e97115 0x322f945f 0x322f8b43 0x32320fcb 0x3256274d 0x3232142b 0x3228503d 0x325f1683 0x325f0ee9 0x325efcb7 0x32562ebd 0x32562d49 0x3613b2eb 0x34478301 0x109bb1 0xfd3b8)
libc++abi.dylib: terminate called throwing an exception
最佳答案
在您的 startForPostWithGraphPath 中,您正在传递刚刚创建的“对象”,但是,您不能将其作为打开图形操作的一部分传递。你应该做的是查看返回的“结果”,从中获取“id”,然后构造一个 NSDictionary(或 FBOpenGraphObject),类似于:
@{ @"quote": 对象ID}
其中 objectID 是第一个帖子结果中的“id”。
关于ios - 在 Facebook 3.5 iOS SDK 中使用 FBRequest 发布开放图操作时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16417476/
我正在使用 Facebook SDK v.3.18.2 我只想要用户的名字、姓氏、电子邮件和出生日期,我得到除出生日期以外的所有信息。 我肯定做错了权限?不确定。 这里有一些代码可以帮助你找出我的问题
我正在关注 Facebook 开发者网站上的示例代码,但我无法获取我的姓名等信息。我正在使用这段代码: - (void)viewDidLoad { [super viewDidLoad];
我遵循了 Facebook 开发者网站关于将 Facebook SDK 3.1 集成到 iOS 6 中的所有说明。我的代码在 iPhone 6.0 模拟器(用户可以登录 Facebook)上完美运行,
我正在我的应用程序中实现 ShareKit。一切正常,我也摆脱了大部分警告(所有警告都是因为 ShareKit 支持 OS 2.x - 我的应用程序支持 3.2 及更高版本,所以我无论如何都不需要这些
var friendRQ: FBRequest = FBRequest(forGraphPath: "me/taggable_friends?fields=name,picture.width(66)
我在尝试将我的 Facebook SDK 升级到最新生产版本时遇到问题(FacebookSDK-3.0.8.pkg - 适用于 iOS 的 Facebook SDK 3.0(更新 1)[2012 年
我搜索了每个地方,但没有得到如何做到这一点的单个提示......我也得到了一些代码,但它不起作用......任何人都可以建议我任何教程或示例代码来做到这一点!提前致谢我正在尝试以下代码:: -(voi
我的 iPhone 应用程序中有一张本地照片,我想将它上传到 Facebook 上专用于我的应用程序的特定相册。 问题:我的应用名称以“照片”一词结尾,因此默认的 Facebook 相册是 APP_N
所以,我在iphone上做了申请。我正在使用 facebook 登录,目前正在将我的 facebooksdk 升级到最新版本。我的一些代码碰巧有错误。下面是我的代码: let request = FB
假设使用Facebook iOS SDK,我对用户的个人资料图片执行了图形请求: [FBRequest requestForGraphPath:@"me/picture"] 我会收到此错误: Resp
我正在尝试使用以下代码使用 iOS SDK 发布开放图操作: [FBRequestConnection startForUploadStagingResourceWithImage:image com
我是一名优秀的程序员,十分优秀!