错误:HTTP状态代码:400我在朋友脸书墙上发布数据时得到这个?

时间:2013-04-02 12:48:04

标签: iphone objective-c facebook xcode4

我正在我的应用程序中选择我的面部书籍朋友我想在我的朋友墙上发布一些文本数据,因为当我按下完成按钮时按下完成按钮我得到了这个error.Error: HTTP status code: 400 呵呵是我的代码

- (void)facebookViewControllerDoneWasPressed:(id)sender {
    NSMutableString *text = [[NSMutableString alloc] init];

    // we pick up the users from the selection, and create a string that we use to update the text view
    // at the bottom of the display; note that self.selection is a property inherited from our base class
    for (id<FBGraphUser> user in self.friendPickerController.selection) {

        NSString *userID = user.id;
        NSLog(@"trying to post image of %@ wall",userID);
        NSMutableDictionary  *postVariablesDictionary = [[NSMutableDictionary alloc] init];
        //[postVariablesDictionary setObject:UIImagePNGRepresentation(image) forKey:@"picture"];
        [postVariablesDictionary setObject:@"my image" forKey:@"message"];

        [FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/photos",userID] parameters:postVariablesDictionary HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
         {
             if (error)
             {
                 //showing an alert for failure
                 UIAlertView *alertView = [[UIAlertView alloc]  initWithTitle:@"Facebook" message:error.localizedDescription                                                                                                delegate:nil   cancelButtonTitle:@"OK"              otherButtonTitles:nil];
                 [alertView show];
             }
             else
             {
                 //showing an alert for success
                 UIAlertView *alertView = [[UIAlertView alloc]  initWithTitle:@"Facebook" message:@"Shared the photo successfully"                                                                                                delegate:nil   cancelButtonTitle:@"OK"              otherButtonTitles:nil];
                 [alertView show];
             }
         }];


    }
     NSLog(@"%@",text);
    [self fillTextBoxAndDismiss];
   }

0 个答案:

没有答案