2012-11-29 103 views
0

我刚刚重新考虑了使用社交框架发布到社交网络的代码(以前的代码与相同的fmw工作正常!)。现在我越来越像错误:访问ACAccountStore时奇怪的崩溃

[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帐户时,会出现这些错误。有什么建议么? PS - 所有的东西都正在进行主线程 - 你可以看到它的屏幕截图

编辑:不知道为什么画面是如此之小,所以请使用变焦

回答

1

这一点也不好笑=)我不小心将计划改为iPhone Simulator 5.0,所以崩溃的原因很明显 - 社会框架出现在iOS 6.0中。我感到困惑,因为该项目没有任何警告编译。

+0

感谢您的关注)) – Stas