草庐IT

boardContentArray

全部标签

json - 从 JSON 字符串中的二维数组中检索值

我们像这样使用REST协议(protocol)获取一些JSON数据。jsonResult=tryNSJSONSerialization.JSONObjectWithData(data!,options:NSJSONReadingOptions.AllowFragments)看起来像这样:jsonResult:({board="[[\"1:\",\"Y\",\"U\",\"P\"]]";})从这里我们得到一个像这样的游戏板:ifletboardContentArray=jsonResult[0]["board"]asNSArray?{print("boardContentArray:\(