【发布时间】:2012-12-11 13:05:55
【问题描述】:
我正在使用以下代码在设备用户的墙上发帖。我也设法获得了朋友列表和他们的 ID。使用朋友的 id 如何根据朋友的 id 使用以下代码在所选朋友的墙上发帖?
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook ];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result) {
if (result == SLComposeViewControllerResultCancelled) {
NSLog(@"Cancelled");
} else {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Posted!!!"
message:@"your status is posted to facebook successfully" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
[controller setInitialText:@" hello there you got a text ..."];
[self presentViewController:controller animated:YES completion:Nil];
}
【问题讨论】:
标签: iphone objective-c ios facebook ios6