Ios 使用Swifter框架在swift中检索Twitter用户图像和名称

Ios 使用Swifter框架在swift中检索Twitter用户图像和名称,ios,swift,twitter,Ios,Swift,Twitter,我使用特定的标签获取推文,但我还需要用户图像和名称 使用这种方法,我可以获取tweet文本,并且可以从JSON响应中读取配置文件图像和用户名,但我无法将其放入变量中 PS:不要介意索引0…19的测试 let swifter = Swifter(consumerKey: "MyConsumerKey", consumerSecret: "MyConsumerSecret", appOnly: true) swifter.authorizeAppOnlyWithSu

我使用特定的标签获取推文,但我还需要用户图像和名称

使用这种方法,我可以获取tweet文本,并且可以从JSON响应中读取配置文件图像和用户名,但我无法将其放入变量中

PS:不要介意索引0…19的测试

        let swifter = Swifter(consumerKey: "MyConsumerKey", consumerSecret: "MyConsumerSecret", appOnly: true)

        swifter.authorizeAppOnlyWithSuccess({ (accessToken, response) -> Void in
        swifter.getSearchTweetsWithQuery("%23realmadrid", geocode: nil, lang: nil, locale: nil, resultType: nil, count: 20, until: nil, sinceID: nil, maxID: nil, includeEntities: true, callback: nil, success: { (statuses, searchMetadata) -> Void in


            for index in 0...19 {
                if let statusText = statuses?[index]["text"].string {
                    self.tweetsArray.addObject(statusText)
                }
                if let statusName = statuses?[index]["screen_name"].string {
                    println("@%@", statusName)
                }
                if let statusImage = statuses?[index]["profile_image_url"].string {
                    println("@%@", statusImage)
                }

            }

            self.tableView.reloadData()


        }, failure: { (error) -> Void in
        })
    }, failure: { (error) -> Void in
        println("error")
    })

对于发现相同问题的任何人:

  if let statusName = statuses?[index]["user"]["screen_name"].string {
                    tweetsDictionary.setObject(statusName, forKey: "name")
                }

  if let statusImage = statuses?[index]["user"]["profile_image_url"].string {
                    var string = statusImage.stringByReplacingOccurrencesOfString("_normal", withString: "", options: NSStringCompareOptions.BackwardsSearch, range: nil)
                    tweetsDictionary.setObject(string, forKey: "image")
                }

这将以用户上传的质量检索twitter用户名和个人资料图像。

hi@Plasher你得到答案了吗???因为我也面临同样的问题,我正在发布答案。你能描述一下代码吗?例如,什么是
状态
?如果你能解释整个代码就太好了。我试过你的建议,但仍然有问题。请看我需要帮助。多谢各位