我无法让社交框架在我的 ios 设备上正常运行,但是它在 iOS 模拟器中运行良好,但在我的 iPad 上却没有,任何人都可以就我可能出错的地方提出建议。提前致谢。
- (IBAction)sharefb:(id)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
mySLComposerSheet = [[SLComposeViewController alloc] init];
mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[mySLComposerSheet setInitialText:@"Share this app with your friends"];
[mySLComposerSheet addImage: [UIImage imageNamed:@"icon2.png"]];
[self presentViewController: mySLComposerSheet animated:
YES completion:nil];
}
[mySLComposerSheet setCompletionHandler:^
(SLComposeViewControllerResult result) {
NSString *output = [[NSString alloc] init];
switch (result) {
case SLComposeViewControllerResultCancelled:
output = @"Post Cancelled";
break;
case SLComposeViewControllerResultDone:
output = @"Posted successfully";
break;
default:
break;
}
}];