Ambiguous use of subscript
来源:互联网 发布:企业网络危机处理 编辑:程序博客网 时间:2024/05/21 18:42
You have to tell the compiler what the intermediary object is in the line
let obj = jsonResult["levels"]![i] as! NSDictionary
After the statement jsonResult["levels"]!
the compiler does not know what kind of object he is dealing with. You have to tell it that is an NSArray
or something else:
let obj = (jsonResult["levels"] as! NSArray)[i] as! NSDictionary
Of course you should additionally make sure that you can actually do all that casting and that the objects inside the json are really of the expected type.
1 0
- Ambiguous use of subscript
- Ambiguous use of 'subscript'
- swift之"ambiguous use of subscript"
- 项目import AVFoundation的时候会出现Ambiguous use of ‘subscript’ 的错误
- Swift使用SDWebImage:Ambiguous use of
- json error: Use of overloaded operator [] is ambiguous
- Subscript of sum
- vector subscript out of range
- vector subscript out of range .
- vector subscript out of range
- string subscript out of range
- Subscript
- subscript
- vector subscript out of range 第一篇
- vector subscript out of range(容器越界)
- 容器赋值 容器使用问题:vector subscript out of range
- vector subscript out of range问题解决方案之一
- Opencv 报错:vector subscript out of range
- 卷积神经网络(CNN)基础介绍
- 真机测试别人的demo才出现"The identity used to sign the executable is no longer valid"
- Android-通知Notification全解析
- WebPack系列教程(三):什么是WebPack
- [iOS]Missing iOS Distribution signing identity for XXXXXX
- Ambiguous use of subscript
- Isolating VM Traffic Using VLANs
- PAT-Speech Patterns (25)
- 关于字符串的截取各种方法讲解
- css中px,em,rem,pt的区别
- select的基本学习
- Linux c 开发 - 内存管理器ptmalloc
- unity3d 在UGUI中制作自适应调整大小的滚动布局控件
- 令operator=返回一个reference to *this