【问题标题】:Get Twitter Profile Pic iPhone iOS5获取 Twitter 个人资料图片 iPhone iOS5
【发布时间】:2023-12-25 04:45:01
【问题描述】:

在获得 Twitter 帐户访问权限后,我需要帮助来获取 Twitter 个人资料图片。下面的代码为我提供了个人资料句柄 (@twitter)。有没有办法在 iOS5 中直接从 Twitter 中提取这些信息?

这是我拥有的适用于手柄的东西:

-(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];

}
}

【问题讨论】:

    标签: iphone twitter camera uiimage


    【解决方案1】:

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

    例如,我的个人资料图片是http://api.twitter.com/1/users/profile_image/don_kim

    你可以在here阅读更多内容。

    【讨论】:

    • 您能否提供一个示例,说明如何在 Objective C 中使用他们的示例? api.twitter.com/1/users/…
    • 忽略我的评论,超级简单。谢谢!
    • @Eric:你能告诉我你是怎么做到的吗?
    • Twitter REST API v1 不再有效。