Objective c 如何访问用户';谁的facebook帐户?OSX山狮

Objective c 如何访问用户';谁的facebook帐户?OSX山狮,objective-c,facebook,macos,cocoa,acaccount,Objective C,Facebook,Macos,Cocoa,Acaccount,我正在使用WWDC的代码访问用户的facebook帐户: self.accountStore = [[ACAccountStore alloc] init]; ACAccountType *facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; [self

我正在使用WWDC的代码访问用户的facebook帐户:

self.accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [self.accountStore
                                      accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[self.accountStore requestAccessToAccountsWithType:facebookAccountType
                             withCompletionHandler:^(BOOL granted, NSError *e) {
                                 if (granted) {
                                     NSArray *accounts = [self.accountStore
                                                          accountsWithAccountType:facebookAccountType];
                                     self.facebookAccount = [accounts lastObject];
                                 } else {
                                     // Fail gracefully...
                                 }
                             }];
但是它在
请求访问AccountsWithType:withCompletionHandler:



如何访问用户的facebook帐户?

facebook支持仅在10.8.2中添加。您正在使用10.8.2吗?如果是,您会得到什么具体的错误代码?我们不是读心术的人



如果您按照预期的方式阅读标题,您将看到Mac上不存在
-requestAccessToAccountsWithType:withCompletionHandler:
,并且在iOS上已被弃用。您应该使用
-requestAccessToAccountsWithType:options:completion:

Facebook支持仅在10.8.2中添加。您正在使用10.8.2吗?如果是,您会得到什么具体的错误代码?我们不是读心术的人



如果您按照预期的方式阅读标题,您将看到Mac上不存在
-requestAccessToAccountsWithType:withCompletionHandler:
,并且在iOS上已被弃用。您应该使用
-requestAccessToAccountsWithType:options:completion:

@PedroVieira:查看我的更新答案。该方法不存在。@PEDRIVEIRA:阅读文档。@PEDRIVEIRA:查看我的更新答案。该方法不存在。@PedroVieira:请阅读文档。