Ios6 accountsWithAccountType返回空数组
第6条。我在设置应用程序中登录到Twitter 我关闭了我的应用程序和设置应用程序,然后重新运行Ios6 accountsWithAccountType返回空数组,ios6,acaccount,Ios6,Acaccount,第6条。我在设置应用程序中登录到Twitter 我关闭了我的应用程序和设置应用程序,然后重新运行 ACAccountStore *store = [[ACAccountStore alloc] init]; ACAccountType *accountType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; [self createAccountPickerForAccountType
ACAccountStore *store = [[ACAccountStore alloc] init];
ACAccountType *accountType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[self createAccountPickerForAccountType:accountType withStore:store];
返回的数组是空数组。我在手机上也看到了这一点,但它在模拟器中工作 我正在做:
ACAccountStore *store = [[ACAccountStore alloc] init];
ACAccountType *twitterAccountType =
[store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[store requestAccessToAccountsWithType:twitterAccountType options:nil^(BOOL granted, NSError *error) {
NSArray *twitterAccounts = [store accountsWithAccountType:twitterAccountType];
int count = [twitterAccounts count];
}];
从
为什么我的应用程序在twitter.com上的属性是“来自iOS”而不是“来自”
如果应用程序尚未在应用商店中运行:
发出请求的应用程序必须在苹果的应用商店中启动,才能在twitter.com上显示属性。请注意,应用程序的iOS5版本必须是实时的,而不仅仅是以前的版本。”
我想知道这是否可能,因为我的应用程序还没有在应用程序商店中呢?我在手机上也看到了这一点,但它在模拟器中工作 我正在做:
ACAccountStore *store = [[ACAccountStore alloc] init];
ACAccountType *twitterAccountType =
[store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[store requestAccessToAccountsWithType:twitterAccountType options:nil^(BOOL granted, NSError *error) {
NSArray *twitterAccounts = [store accountsWithAccountType:twitterAccountType];
int count = [twitterAccounts count];
}];
从
为什么我的应用程序在twitter.com上的属性是“来自iOS”而不是“来自”
如果应用程序尚未在应用商店中运行:
发出请求的应用程序必须在苹果的应用商店中启动,才能在twitter.com上显示属性。请注意,应用程序的iOS5版本必须是实时的,而不仅仅是以前的版本。”
我想知道是否可以,因为我的应用程序还没有在应用程序商店中?更新:找到了!在计数开始工作之前,您必须请求权限(并授予权限)。要请求权限,请使用[ACAccountStore requestAccessToAccountsWithType]更新:解决它!在计数开始工作之前,您必须请求权限(并授予权限)。要请求权限,请使用[ACAccountStore requestAccessToAccountsWithType]