我第一次遇到这样的问题,需要你的帮助。
我正在获取 twitter 用户信息,并且使用 NSLog 我可以在控制台中看到它,但是当我在标签或文本视图上显示它时,它需要更多时间,几乎是 1 分钟。
我正在使用的代码是....
_accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [_accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[_accountStore requestAccessToAccountsWithType:accountType options:nil
completion:^(BOOL granted, NSError *error)
// Request access from the user to use their Twitter accounts.
{
// Did user allow us access?
if (granted == YES)
{
// Populate array with all available Twitter accounts
NSArray *arrayOfAccounts = [_accountStore accountsWithAccountType:accountType];
[arrayOfAccounts retain];
// Populate the tableview
if ([arrayOfAccounts count] > 0)
NSLog(@"print %@",[arrayOfAccounts objectAtIndex:0]);
//
ACAccount *twitterAccount = [arrayOfAccounts objectAtIndex:0];
NSString *userID = [[twitterAccount valueForKey:@"properties"] valueForKey:@"user_id"];
NSLog(@"print user id is %@",userID);// Here i can see immediately
testLabel.text=[NSString stringWithFormat: @"Hi ,%@",userID];// Here it is taking more time...