2012-01-13 183 views
1

我需要帮助获取Twitter个人资料照片,一旦我被授予访问Twitter帐户的权限。下面的代码让我知道配置文件句柄(@twitter)。有没有办法在iOS5中直接从Twitter获取这些信息?获取Twitter个人资料图片iPhone iOS5

这里就是我有,对于手柄的工作原理:

-(void)getTwitterName 
{ 
    ACAccountStore *accountStore = [[ACAccountStore alloc] init]; 
    ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; 

    [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) 

    { 
     if(granted) { 
      NSArray *accountsArray = [accountStore accountsWithAccountType:accountType]; 

} 
} 

回答

2

您可以从以下网址获得它:http://api.twitter.com/1/users/profile_image/:screen_name.format

我的轮廓影像,例如,将http://api.twitter.com/1/users/profile_image/don_kim

你可以阅读更多内容here

+0

你能否提供一个如何在Objective C中使用他们的示例get的例子? https://api.twitter.com/1/users/profile_image?screen_name=twitterapi&size=bigger – Eric 2012-01-17 15:40:19

+0

忽略我的评论,这很容易。谢谢! – Eric 2012-01-17 16:50:57

+0

@Eric:你能告诉我你是怎么做到的? – 2013-07-10 10:48:11

相关问题