无法在表格视图的标签上打印Twitter响应

时间:2018-07-30 05:39:45

标签: ios swift twitterkit fhs-twitter-engine

我收到了twitter v 11 api响应,并且我填满了数组,但是从此我无法在tableview上打印,这是响应

[(Swift.ImplicitlyUnwrappedOptional<Any>.some(<__NSArrayM 0x600000842520>(
{
    contributors = "";
    coordinates = "";
    "created_at" = "Thu Jul 12 11:49:57 +0000 2018";
    entities =     {
        hashtags =         (
        );
        media =         (
                        {
                "display_url" = "pic.twitter.com/IJtq6aLM7K";
                "expanded_url" = "";
                id = 1017375504448479232;
                "id_str" = 1017375504448479232;
                indices =                 (
                    12,
                    35
                );
                "media_url" = "";
                "media_url_https" = "";
                sizes =                 {
                    large =                     {
                        h = 1820;
                        resize = fit;
                        w = 2048;
                    };
                    medium =                     {
                        h = 1067;
                        resize = fit;
                        w = 1200;
                    };
                    small =                     {
                        h = 604;
                        resize = fit;
                        w = 680;
                    };
                    thumb =                     {
                        h = 150;
                        resize = crop;
                        w = 150;
                    };
                };
                type = photo;
                url = "";
            }
        );
        symbols =         (
        );
        urls =         (
        );
        "user_mentions" =         (
        );
    };
    "extended_entities" =     {
        media =         (
                        {
                "display_url" = "pic.twitter.com/IJtq6aLM7K";
                "expanded_url" = "";
                id = 1017375504448479232;
                "id_str" = 1017375504448479232;
                indices =                 (
                    12,
                    35
                );
                "media_url" = "";
                "media_url_https" = "";
                sizes =                 {
                    large =                     {
                        h = 1820;
                        resize = fit;
                        w = 2048;
                    };
                    medium =                     {
                        h = 1067;
                        resize = fit;
                        w = 1200;
                    };
                    small =                     {
                        h = 604;
                        resize = fit;
                        w = 680;
                    };
                    thumb =                     {
                        h = 150;
                        resize = crop;
                        w = 150;
                    };
                };
                type = photo;
                url = "";
            }
        );
    };
    "favorite_count" = 0;
    favorited = 0;
    geo = "";
    id = 1017375507174719488;
    "id_str" = 1017375507174719488;
    "in_reply_to_screen_name" = "";
    "in_reply_to_status_id" = "";
    "in_reply_to_status_id_str" = "";
    "in_reply_to_user_id" = "";
    "in_reply_to_user_id_str" = "";
    "is_quote_status" = 0;
    lang = fr;
    place = "";
    "possibly_sensitive" = 0;
    "retweet_count" = 0;
    retweeted = 0;
    source = "";
    text = "Tweet Tweet";
    truncated = 0;

这是我的代码,我在其中填充数组

从此代码中我得到响应

var timeline = (FHSTwitterEngine.shared().getTimelineForUser(FHSTwitterEngine.shared().authenticatedUsername, isID: true, count: 10), terminator: "")

现在我像这样填充数组

 var serviceData : [AnyObject]=[]
 let timelinedata = [timeline] as [AnyObject]
        serviceData = (timelinedata)
        print(serviceData)

我现在正在尝试在服务数据中获得完整的响应,如下图所示

let retweerCount = serviceData[indexPath.row]["retweet_count"]
            cell.lblRetweet.text = retweerCount as? String

我无法打印的坚果可以给我解决方案

1 个答案:

答案 0 :(得分:0)

我认为retweerCount不在integer中,所以请使用以下代码。

string