【发布时间】:2014-04-13 03:20:19
【问题描述】:
我正在使用 Parse.com 服务作为我的云在 iOS 上工作。
我当前的任务是尝试从 Facebook 检索朋友列表,然后将该列表保存到解析云。
我可以使用 parse.com 的示例/教程为 PFObject 保存一个 PFObject,但是当我尝试保存我的对象列表时它不起作用。
那么你能解释一下我的原因吗?在我的情况下,解决方案是什么?
我的代码:
for (NSDictionary<FBGraphUser>* friend_ in friends) {
NSLog(@"I have a friend named %@ with id %@", friend_.name, friend_.id);
PFObject *gameScore = [PFObject objectWithClassName:@"GameScore"];
NSLog(@"Add ID");
gameScore[@"id"] = friend_.id;
NSLog(@"Name");
gameScore[@"name"] = friend_.name;
NSLog(@"Birthday");
gameScore[@"birthday"] = friend_.birthday;
[gameScore saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (!error) {
NSLog(@"Sample sending completed");
}
}];
}
【问题讨论】:
-
具体是什么不起作用?你收到 Parse 的错误了吗?
-
什么都没有。我也尝试检查数据浏览器,但没有数据发送到那里
-
saveInBackgroundWithBlock 返回成功还是错误?
-
感谢 Brandon,它甚至什么都不返回
标签: ios facebook parse-platform cocos2d-x