0

我正在使用适用于 iOS 的最新 facebook SDK 3.8。我想在墙上发表评论,但我遇到了麻烦。我正在使用的以下方法可能会工作一次或两次,然后给我错误:

 Error: The operation couldn’t be completed. (com.facebook.sdk error 5.)

我不确定这是否与“过度”发帖有关,因为当这种情况发生时我只发了两次,而且每次都在不同的帖子上。就像我说的那样,它无处不在(每次都是成功之前)。所以我相信这是我的代码。谁能告诉我我这样做是否正确?

谢谢!

-(BOOL) postComment: (NSString *) postID :(NSString *) userPostMessage;
{
__block BOOL value;
postID=[NSString stringWithFormat:@"/%@/comments?message=%@",postID,userPostMessage];
[FBSession activeSession];

[FBRequestConnection startWithGraphPath:postID parameters:0 HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    BOOL temp;
    if (error)
    {
          NSLog(@"Error: %@", [error localizedDescription]);
        temp = TRUE;
    }
    else
    {
         NSLog(@"Result: %@", result);
        valueReturned = (NSString*)result;
        temp = FALSE;
    }
    value = temp;

}];
return value;

}
4

0 回答 0