SLComposeViewController在ios8中崩溃

时间:2014-09-04 04:33:17

标签: ios iphone ios8 slcomposeviewcontroller

SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
        controller.view.hidden = YES;
        [self presentViewController:controller animated:NO completion:^{
            [controller.view endEditing:YES];
        }];

此代码在iOS6和& iOS7但它在iOS 8中崩溃了:

**2014-09-03 08:48:19.545 [1254:248164] Error: The operation couldn’t be completed. (com.apple.accounts error 6.)
2014-09-03 08:48:19.558[1254:248164] Discovered extensions: {(
 <NSExtension: 0x17013eaa0> {id = com.apple.share.SinaWeibo.post},
 <NSExtension: 0x17013ee60> {id = com.apple.share.Facebook.post},
 <NSExtension: 0x17013ebe0> {id = com.apple.share.Twitter.post},
 <NSExtension: 0x17013f400> {id = com.apple.share.TencentWeibo.post},
 <NSExtension: 0x17013e780> {id = com.apple.share.Vimeo.post},
 <NSExtension: 0x17013e6e0> {id = com.apple.share.Flickr.post},
 <NSExtension: 0x17013e640> {id = com.apple.mobileslideshow.StreamShareService}
)} for attributes: {
 NSExtensionPointName = "com.apple.share-services";
}**

获取:: **LaunchServices: invalidationHandler called**

的错误消息

2 个答案:

答案 0 :(得分:1)

这不是解决方案,您需要升级iOS8和Xcode 6.0.1的facebook版本,这将适用于iOS7和iOS8 +。

答案 1 :(得分:0)

我在iOS8中获得该问题的解决方案,controller.view.hidden = YES;中的问题,在iOS8默认设置警报视图隐藏在视图中,我使用这个简单的代码用于iOS7&amp; iOS8上

if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
        controller.view.hidden = YES;
else
    controller.view.hidden = NO;