无法发布faceBook状态iOS Facebook SDK 3.0

时间:2013-02-09 01:14:40

标签: ios facebook sdk facebook-javascript-sdk fbconnect

I've used this example to implement FaceBook SDK 3.0.唯一不同的是我使用导航控制器弹出Facebook笔尖。

模拟器在下面的代码中得到一个sigabrt。任何人都可以在代码中找到错误吗?

if(alertView.tag == 200){             //帖子状态

        [FBRequestConnection startForPostStatusUpdate:myStatus.text completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
            if (!error) {
                UIAlertView *tmp = [[UIAlertView alloc] 
                                    initWithTitle:@"Success" 
                                    message:@"Status Posted"
                                    delegate:self 
                                    cancelButtonTitle:nil
                                    otherButtonTitles:@"Ok", nil];

                [tmp show];
                [tmp release];
            } else {
                UIAlertView *tmp = [[UIAlertView alloc] 
                                    initWithTitle:@"Error" 
                                    message:@"Some error happened"
                                    delegate:self 
                                    cancelButtonTitle:nil
                                    otherButtonTitles:@"Ok", nil];

                [tmp show];
                [tmp release];
            }
        }];
    }

这是整个方法:` - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {

if (buttonIndex==1) { // yes answer
    if (alertView.tag==100) {
        // then upload
        [self controlStatusUsable:NO];
        [FBRequestConnection startForUploadPhoto:myImg.image 
                               completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                                   if (!error) {
                                       UIAlertView *tmp = [[UIAlertView alloc] 
                                                           initWithTitle:@"Success" 
                                                           message:@"Photo Uploaded"
                                                           delegate:self 
                                                           cancelButtonTitle:nil
                                                           otherButtonTitles:@"Ok", nil];

                                       [tmp show];
                                       [tmp release];
                                   } else {
                                       UIAlertView *tmp = [[UIAlertView alloc] 
                                                           initWithTitle:@"Error" 
                                                           message:@"Some error happened"
                                                           delegate:self 
                                                           cancelButtonTitle:nil
                                                           otherButtonTitles:@"Ok", nil];

                                       [tmp show];
                                       [tmp release];
                                   }

                                   [self controlStatusUsable:YES];
                               }];

    }

    if (alertView.tag==200) {
        // the post status

        [FBRequestConnection startForPostStatusUpdate:myStatus.text completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
            if (!error) {
                UIAlertView *tmp = [[UIAlertView alloc] 
                                    initWithTitle:@"Success" 
                                    message:@"Status Posted"
                                    delegate:self 
                                    cancelButtonTitle:nil
                                    otherButtonTitles:@"Ok", nil];

                [tmp show];
                [tmp release];
            } else {
                UIAlertView *tmp = [[UIAlertView alloc] 
                                    initWithTitle:@"Error" 
                                    message:@"Some error happened"
                                    delegate:self 
                                    cancelButtonTitle:nil
                                    otherButtonTitles:@"Ok", nil];

                [tmp show];
                [tmp release];
            }
        }];
    }

}

}`

0 个答案:

没有答案