Ios 为什么从帐户加载Twitter帐户要花这么长时间?
下面是我用来访问存储在设备上的twitter帐户的代码;在我的设备上加载通常需要30秒左右,在模拟器上加载要快得多Ios 为什么从帐户加载Twitter帐户要花这么长时间?,ios,twitter,acaccount,Ios,Twitter,Acaccount,下面是我用来访问存储在设备上的twitter帐户的代码;在我的设备上加载通常需要30秒左右,在模拟器上加载要快得多 ACAccountStore *account = [[ACAccountStore alloc] init]; ACAccountType *accountType = [account accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter
ACAccountStore *account = [[ACAccountStore alloc] init];
ACAccountType *accountType = [account
accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[account requestAccessToAccountsWithType:accountType
options:nil completion:^(BOOL granted, NSError *error)
{
if (granted == YES)
{
NSArray *arrayOfAccounts = [account
accountsWithAccountType:accountType];
if ([arrayOfAccounts count] > 0)
{
self.twitterAccount =
[arrayOfAccounts lastObject];
UIAlertView* loggedInAlert = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"Successfully logged in to Twitter" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[loggedInAlert show];
}
else {
NSLog(@"There are not any accounts to post to");
self.twitterAccount = NULL;
UIAlertView* noAccountAlert = [[UIAlertView alloc] initWithTitle:@"No Twitter Account Found" message:@"Check the settings of your device and make sure you are logged in to Twitter" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[noAccountAlert show];
}
} else {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Authentication Failed" message:@"Failed to gain access to Twitter account" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}
}];
您是否在设备上启用了网络调节功能?我从未启用过。但是,即使这是我需要做的事情,我也不能合理地期望其他用户会这样做,是吗?不,我不能。网络调节是为了测试目的故意降低连接速度。用户将没有此选项。