Giter Site home page Giter Site logo

Comments (5)

mozhenhau avatar mozhenhau commented on August 24, 2024

额,我是在代码中模拟数据才用中括号的。 看一下你的代码

from d3json.

angelen10 avatar angelen10 commented on August 24, 2024

我是使用Alamofire和SwiftyJSON来请求数据以及解析JSON的,代码如下:

Alamofire.request(.GET, "http://gank.avosapps.com/api/data/iOS/20/2").responseJSON { response in
            guard let jsonStr = response.result.value else {
                // 处理失败的情况
                return
            }

            let json = JSON(jsonStr)
            print("json:\(json)")
            // 我只需要里面那个JSON数组
            let jsonThatNeed = json["results"].description
            print("jsonThatNeed:\(jsonThatNeed)")

            let iOSList = IOS.jsonToModelList(jsonThatNeed) as! Array<IOS>
            print("count = \(iOSList.count)")
        }

我的IOS类如下:

@objc(IOS)
class IOS: D3Model {
    var updatedAt = ""
    var who = ""
    var publishedAt = ""
    var objectId = ""
    var used = ""
    var type = ""
    var createdAt = ""
    var desc = ""
    var url = ""
}

我是使用你最新的D3Json的。
打印如下:

json:{
  "error" : false,
  "results" : [
    {
      "updatedAt" : "2015-10-23T04:01:16.763Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-23T04:01:16.226Z",
      "objectId" : "5628b56160b25974b265225e",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-22T10:07:29.161Z",
      "desc" : "JSON - Swifter ",
      "url" : "http:\/\/swifter.tips\/json\/"
    },
    {
      "updatedAt" : "2015-10-23T04:01:16.760Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-23T04:01:16.225Z",
      "objectId" : "5628b50600b0a6792bf365ab",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-22T10:05:58.029Z",
      "desc" : " Swift 中的代码优化细节",
      "url" : "http:\/\/blog.callmewhy.com\/2015\/10\/21\/extension-in-yoapp\/"
    },
    {
      "updatedAt" : "2015-10-23T04:01:38.613Z",
      "who" : "mthli",
      "publishedAt" : "2015-10-23T04:01:16.224Z",
      "objectId" : "56288e8e00b07d3622e5bb10",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-22T07:21:50.104Z",
      "desc" : "Yalantis 推出的星球大战动画效果",
      "url" : "https:\/\/github.com\/Yalantis\/StarWars.iOS"
    },
    {
      "updatedAt" : "2015-10-22T02:06:08.396Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-22T02:06:07.739Z",
      "objectId" : "5626395300b0023ca69d6c1d",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-20T12:53:39.638Z",
      "desc" : "强制修改 iOS 状态栏颜色",
      "url" : "http:\/\/www.jianshu.com\/p\/9d6b6f790493"
    },
    {
      "updatedAt" : "2015-10-22T02:06:08.368Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-22T02:06:07.737Z",
      "objectId" : "5626370760b2fcfb90e5a48a",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-20T12:43:51.894Z",
      "desc" : "iOS开发中的Git流程",
      "url" : "http:\/\/www.jianshu.com\/p\/87e34894a9f9?utm_campaign=maleskine&utm_content=note&utm_medium=writer_share&utm_source=weibo"
    },
    {
      "updatedAt" : "2015-10-22T02:06:08.282Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-22T02:06:07.735Z",
      "objectId" : "5621adae00b07c4deec03587",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-17T02:08:46.462Z",
      "desc" : "MonkeyKing —— 不使用官方 SDK 集成微博,微信分享",
      "url" : "http:\/\/tips.producter.io\/shi-yong\/"
    },
    {
      "updatedAt" : "2015-10-22T02:06:08.368Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-22T02:06:07.734Z",
      "objectId" : "5621ac3460b2b199f723cb9a",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-17T02:02:28.054Z",
      "desc" : "让你快速上手Runtime",
      "url" : "http:\/\/www.jianshu.com\/p\/e071206103a4"
    },
    {
      "updatedAt" : "2015-10-22T02:06:08.278Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-22T02:06:07.732Z",
      "objectId" : "560fd9d360b267e6dbc0a0fd",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-03T13:36:19.668Z",
      "desc" : "iOS9正确获取用户语言设置 ",
      "url" : "http:\/\/blog.yourtion.com\/get-current-language-on-ios9.html?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
    },
    {
      "updatedAt" : "2015-10-22T02:06:08.372Z",
      "who" : "CallMeWhy",
      "publishedAt" : "2015-10-22T02:06:07.724Z",
      "objectId" : "560b2b1d60b2c218f8a43934",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-09-30T00:21:49.349Z",
      "desc" : "iOS9手势进阶:聚合和预测",
      "url" : "http:\/\/flexmonkey.blogspot.com\/2015\/09\/advanced-touch-handling-in-ios9.html"
    },
    {
      "updatedAt" : "2015-10-21T02:57:41.273Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-21T02:57:40.911Z",
      "objectId" : "56263ab400b0cfba0796e9c1",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-20T12:59:32.052Z",
      "desc" : "一个录音Demo-Swift语言实现",
      "url" : "http:\/\/www.jianshu.com\/p\/f0b88355d7cb"
    },
    {
      "updatedAt" : "2015-10-21T02:57:41.442Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-21T02:57:40.910Z",
      "objectId" : "5626393300b0d1db9b4da09d",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-20T12:53:07.616Z",
      "desc" : "盘点国内程序员不常用的热门iOS第三方库",
      "url" : "http:\/\/www.cnblogs.com\/ios122\/p\/4873334.html"
    },
    {
      "updatedAt" : "2015-10-21T02:57:41.435Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-21T02:57:40.909Z",
      "objectId" : "5626376300b0d1db9b4d6004",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-20T12:45:23.219Z",
      "desc" : "加载网络图片第三方库ssloadURLImage",
      "url" : "https:\/\/github.com\/shareJOBS\/ssloadURLImage"
    },
    {
      "updatedAt" : "2015-10-21T02:57:41.152Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-21T02:57:40.901Z",
      "objectId" : "5610c9f0ddb2e44a6273a882",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-04T06:40:48.077Z",
      "desc" : "在 Xcode 的模拟器上支持 Force Touch 的小插件",
      "url" : "http:\/\/gold.xitu.io\/entry\/5610271300b098870f7b52c1"
    },
    {
      "updatedAt" : "2015-10-21T02:57:41.146Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-21T02:57:40.900Z",
      "objectId" : "560e0b4560b2c218f8ea7508",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-02T04:42:45.027Z",
      "desc" : "iOS开发周报:iPhone 6s 本周发货,Dropbox 开源组群通讯工具",
      "url" : "http:\/\/www.infoq.com\/cn\/news\/2015\/09\/ios-weekly-iphone6s?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global"
    },
    {
      "updatedAt" : "2015-10-21T02:57:41.255Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-21T02:57:40.898Z",
      "objectId" : "560d6bf960b296fcc86f5319",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-01T17:23:05.392Z",
      "desc" : "VirwMonitor点击测量视图位置、大小、背景、字体大小等信息",
      "url" : "https:\/\/github.com\/daisuke0131\/ViewMonitor"
    },
    {
      "updatedAt" : "2015-10-20T03:45:37.646Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-20T03:45:36.981Z",
      "objectId" : "5625afc260b28da56ffebc7d",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-20T03:06:42.708Z",
      "desc" : " iOS 精益编程",
      "url" : "http:\/\/blog.csdn.net\/uxyheaven\/article\/details\/49226175?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
    },
    {
      "updatedAt" : "2015-10-20T03:45:37.401Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-20T03:45:36.977Z",
      "objectId" : "5624b28c60b2fe711171eecc",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-19T09:06:20.701Z",
      "desc" : "可视化编程 Tips 之“消灭重复又无聊的代码之 UITableView 篇”",
      "url" : "https:\/\/autolayout.club\/2015\/10\/18\/%E5%8F%AF%E8%A7%86%E5%8C%96%E7%BC%96%E7%A8%8B-Tips-%E4%B9%8B%E2%80%9C%E6%B6%88%E7%81%AD%E9%87%8D%E5%A4%8D%E5%8F%88%E6%97%A0%E8%81%8A%E7%9A%84%E4%BB%A3%E7%A0%81%E4%B9%8B-UITableView-%E7%AF%87%E2%80%9D\/?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
    },
    {
      "updatedAt" : "2015-10-20T03:45:37.466Z",
      "who" : "CallMeWhy",
      "publishedAt" : "2015-10-20T03:45:36.967Z",
      "objectId" : "561c9516ddb26e2181f486df",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-13T05:22:30.859Z",
      "desc" : "用 Swift Framework 封装 C 语言库",
      "url" : "http:\/\/colindrake.me\/2015\/10\/05\/wrapping-a-c-library-in-a-swift-framework\/"
    },
    {
      "updatedAt" : "2015-10-20T03:45:37.481Z",
      "who" : "Andrew Liu",
      "publishedAt" : "2015-10-20T03:45:36.966Z",
      "objectId" : "561b4bec00b0afd4ea400712",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-12T05:58:04.868Z",
      "desc" : "iOS应用架构谈 本地持久化方案及动态部署Liu\n",
      "url" : "http:\/\/casatwy.com\/iosying-yong-jia-gou-tan-ben-di-chi-jiu-hua-fang-an-ji-dong-tai-bu-shu.html?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
    },
    {
      "updatedAt" : "2015-10-20T03:45:37.230Z",
      "who" : "CallMeWhy",
      "publishedAt" : "2015-10-20T03:45:36.965Z",
      "objectId" : "5613be0e00b086643664d70e",
      "used" : true,
      "type" : "iOS",
      "createdAt" : "2015-10-06T12:26:54.430Z",
      "desc" : "Swift 思考:第三部分,class 还是 struct",
      "url" : "http:\/\/alisoftware.github.io\/swift\/2015\/10\/03\/thinking-in-swift-3\/"
    }
  ]
}
jsonThatNeed:[
  {
    "updatedAt" : "2015-10-23T04:01:16.763Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-23T04:01:16.226Z",
    "objectId" : "5628b56160b25974b265225e",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-22T10:07:29.161Z",
    "desc" : "JSON - Swifter ",
    "url" : "http:\/\/swifter.tips\/json\/"
  },
  {
    "updatedAt" : "2015-10-23T04:01:16.760Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-23T04:01:16.225Z",
    "objectId" : "5628b50600b0a6792bf365ab",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-22T10:05:58.029Z",
    "desc" : " Swift 中的代码优化细节",
    "url" : "http:\/\/blog.callmewhy.com\/2015\/10\/21\/extension-in-yoapp\/"
  },
  {
    "updatedAt" : "2015-10-23T04:01:38.613Z",
    "who" : "mthli",
    "publishedAt" : "2015-10-23T04:01:16.224Z",
    "objectId" : "56288e8e00b07d3622e5bb10",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-22T07:21:50.104Z",
    "desc" : "Yalantis 推出的星球大战动画效果",
    "url" : "https:\/\/github.com\/Yalantis\/StarWars.iOS"
  },
  {
    "updatedAt" : "2015-10-22T02:06:08.396Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-22T02:06:07.739Z",
    "objectId" : "5626395300b0023ca69d6c1d",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-20T12:53:39.638Z",
    "desc" : "强制修改 iOS 状态栏颜色",
    "url" : "http:\/\/www.jianshu.com\/p\/9d6b6f790493"
  },
  {
    "updatedAt" : "2015-10-22T02:06:08.368Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-22T02:06:07.737Z",
    "objectId" : "5626370760b2fcfb90e5a48a",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-20T12:43:51.894Z",
    "desc" : "iOS开发中的Git流程",
    "url" : "http:\/\/www.jianshu.com\/p\/87e34894a9f9?utm_campaign=maleskine&utm_content=note&utm_medium=writer_share&utm_source=weibo"
  },
  {
    "updatedAt" : "2015-10-22T02:06:08.282Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-22T02:06:07.735Z",
    "objectId" : "5621adae00b07c4deec03587",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-17T02:08:46.462Z",
    "desc" : "MonkeyKing —— 不使用官方 SDK 集成微博,微信分享",
    "url" : "http:\/\/tips.producter.io\/shi-yong\/"
  },
  {
    "updatedAt" : "2015-10-22T02:06:08.368Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-22T02:06:07.734Z",
    "objectId" : "5621ac3460b2b199f723cb9a",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-17T02:02:28.054Z",
    "desc" : "让你快速上手Runtime",
    "url" : "http:\/\/www.jianshu.com\/p\/e071206103a4"
  },
  {
    "updatedAt" : "2015-10-22T02:06:08.278Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-22T02:06:07.732Z",
    "objectId" : "560fd9d360b267e6dbc0a0fd",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-03T13:36:19.668Z",
    "desc" : "iOS9正确获取用户语言设置 ",
    "url" : "http:\/\/blog.yourtion.com\/get-current-language-on-ios9.html?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
  },
  {
    "updatedAt" : "2015-10-22T02:06:08.372Z",
    "who" : "CallMeWhy",
    "publishedAt" : "2015-10-22T02:06:07.724Z",
    "objectId" : "560b2b1d60b2c218f8a43934",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-09-30T00:21:49.349Z",
    "desc" : "iOS9手势进阶:聚合和预测",
    "url" : "http:\/\/flexmonkey.blogspot.com\/2015\/09\/advanced-touch-handling-in-ios9.html"
  },
  {
    "updatedAt" : "2015-10-21T02:57:41.273Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-21T02:57:40.911Z",
    "objectId" : "56263ab400b0cfba0796e9c1",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-20T12:59:32.052Z",
    "desc" : "一个录音Demo-Swift语言实现",
    "url" : "http:\/\/www.jianshu.com\/p\/f0b88355d7cb"
  },
  {
    "updatedAt" : "2015-10-21T02:57:41.442Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-21T02:57:40.910Z",
    "objectId" : "5626393300b0d1db9b4da09d",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-20T12:53:07.616Z",
    "desc" : "盘点国内程序员不常用的热门iOS第三方库",
    "url" : "http:\/\/www.cnblogs.com\/ios122\/p\/4873334.html"
  },
  {
    "updatedAt" : "2015-10-21T02:57:41.435Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-21T02:57:40.909Z",
    "objectId" : "5626376300b0d1db9b4d6004",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-20T12:45:23.219Z",
    "desc" : "加载网络图片第三方库ssloadURLImage",
    "url" : "https:\/\/github.com\/shareJOBS\/ssloadURLImage"
  },
  {
    "updatedAt" : "2015-10-21T02:57:41.152Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-21T02:57:40.901Z",
    "objectId" : "5610c9f0ddb2e44a6273a882",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-04T06:40:48.077Z",
    "desc" : "在 Xcode 的模拟器上支持 Force Touch 的小插件",
    "url" : "http:\/\/gold.xitu.io\/entry\/5610271300b098870f7b52c1"
  },
  {
    "updatedAt" : "2015-10-21T02:57:41.146Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-21T02:57:40.900Z",
    "objectId" : "560e0b4560b2c218f8ea7508",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-02T04:42:45.027Z",
    "desc" : "iOS开发周报:iPhone 6s 本周发货,Dropbox 开源组群通讯工具",
    "url" : "http:\/\/www.infoq.com\/cn\/news\/2015\/09\/ios-weekly-iphone6s?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global"
  },
  {
    "updatedAt" : "2015-10-21T02:57:41.255Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-21T02:57:40.898Z",
    "objectId" : "560d6bf960b296fcc86f5319",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-01T17:23:05.392Z",
    "desc" : "VirwMonitor点击测量视图位置、大小、背景、字体大小等信息",
    "url" : "https:\/\/github.com\/daisuke0131\/ViewMonitor"
  },
  {
    "updatedAt" : "2015-10-20T03:45:37.646Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-20T03:45:36.981Z",
    "objectId" : "5625afc260b28da56ffebc7d",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-20T03:06:42.708Z",
    "desc" : " iOS 精益编程",
    "url" : "http:\/\/blog.csdn.net\/uxyheaven\/article\/details\/49226175?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
  },
  {
    "updatedAt" : "2015-10-20T03:45:37.401Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-20T03:45:36.977Z",
    "objectId" : "5624b28c60b2fe711171eecc",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-19T09:06:20.701Z",
    "desc" : "可视化编程 Tips 之“消灭重复又无聊的代码之 UITableView 篇”",
    "url" : "https:\/\/autolayout.club\/2015\/10\/18\/%E5%8F%AF%E8%A7%86%E5%8C%96%E7%BC%96%E7%A8%8B-Tips-%E4%B9%8B%E2%80%9C%E6%B6%88%E7%81%AD%E9%87%8D%E5%A4%8D%E5%8F%88%E6%97%A0%E8%81%8A%E7%9A%84%E4%BB%A3%E7%A0%81%E4%B9%8B-UITableView-%E7%AF%87%E2%80%9D\/?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
  },
  {
    "updatedAt" : "2015-10-20T03:45:37.466Z",
    "who" : "CallMeWhy",
    "publishedAt" : "2015-10-20T03:45:36.967Z",
    "objectId" : "561c9516ddb26e2181f486df",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-13T05:22:30.859Z",
    "desc" : "用 Swift Framework 封装 C 语言库",
    "url" : "http:\/\/colindrake.me\/2015\/10\/05\/wrapping-a-c-library-in-a-swift-framework\/"
  },
  {
    "updatedAt" : "2015-10-20T03:45:37.481Z",
    "who" : "Andrew Liu",
    "publishedAt" : "2015-10-20T03:45:36.966Z",
    "objectId" : "561b4bec00b0afd4ea400712",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-12T05:58:04.868Z",
    "desc" : "iOS应用架构谈 本地持久化方案及动态部署Liu\n",
    "url" : "http:\/\/casatwy.com\/iosying-yong-jia-gou-tan-ben-di-chi-jiu-hua-fang-an-ji-dong-tai-bu-shu.html?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io"
  },
  {
    "updatedAt" : "2015-10-20T03:45:37.230Z",
    "who" : "CallMeWhy",
    "publishedAt" : "2015-10-20T03:45:36.965Z",
    "objectId" : "5613be0e00b086643664d70e",
    "used" : true,
    "type" : "iOS",
    "createdAt" : "2015-10-06T12:26:54.430Z",
    "desc" : "Swift 思考:第三部分,class 还是 struct",
    "url" : "http:\/\/alisoftware.github.io\/swift\/2015\/10\/03\/thinking-in-swift-3\/"
  }
]
count = 0

from d3json.

angelen10 avatar angelen10 commented on August 24, 2024

数据都已经回来了,我是将返回回来的数据转换成JSON,然后拿到“results”键的值(JSON数组),再将它转换成String,然后传进你那个D3Json的参数里。

from d3json.

mozhenhau avatar mozhenhau commented on August 24, 2024
        guard let json = response.result else {
            // 处理失败的情况
            return
        }
        print("json:\(json)")
        // 我只需要里面那个JSON数组
        let jsonThatNeed = json["results"]
        print("jsonThatNeed:\(jsonThatNeed)")

        let iOSList = IOS.jsonToModelList(jsonThatNeed) as! Array<IOS>
        print("count = \(iOSList.count)")

1.不需要用到SwiftJson,response就能获取到json对象了,然后获取json里的results
2.删除description,传进去的不是字符串,传字典或者字典数组

from d3json.

angelen10 avatar angelen10 commented on August 24, 2024

Perfect solution!😘

from d3json.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.