访问ACAccountStore时出现奇怪的崩溃

时间:2012-11-29 08:13:39

标签: iphone objective-c ios6

我刚刚重新考虑了使用社交框架发布到社交网络的代码(之前的代码与同样的fmw工作正常!)。现在我收到的错误如下:

[ACAccountStore requestAccessToAccountsWithType:options:completion:]: unrecognized selector sent to instance

我已经记录了帐户商店对象,但它存在 - store is: <ACAccountStore: 0x8c2cec0>

崩溃的代码:

NSLog(@"[SocialSharingManager sharedInstance].accountStore is:
 %@", [SocialSharingManager sharedInstance].accountStore);   
ACAccountType * facebookAccountType = [[SocialSharingManager sharedInstance].accountStore
 accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary * options = @{ACFacebookAppIdKey : kFacebookAppId, ACFacebookPermissionsKey : permissions, ACFacebookAudienceKey : ACFacebookAudienceEveryone};
[[SocialSharingManager sharedInstance].accountStore
 requestAccessToAccountsWithType:facebookAccountType options:options completion:^(BOOL granted, NSError *error) {

            if (granted) {...}

第二种错误:

enter image description here

当我尝试访问FB或Twitter帐户时会出现这些错误。有什么建议? P.S - 所有事情都在主线上 - 你可以在屏幕上看到它

编辑:不知道图片为何如此之小,所以请使用缩放

1 个答案:

答案 0 :(得分:1)

那不好笑=)我不小心将计划改为iPhone模拟器5.0,因此崩溃的原因很明显 - 社交框架出现在iOS 6.0中。我感到很困惑,因为该项目没有任何警告。