小编Mob*_*eMe的帖子

带索引的Swift访问数组会产生以下错误.知道为什么吗?

let index1 = arc4random_uniform(10);

let x = array[index1];
Run Code Online (Sandbox Code Playgroud)

第二行是给出以下错误

could not find an overload for 'subscript' that accepts the supplied arguments

let x = array[index1];
        ^~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)

swift

2
推荐指数
1
解决办法
668
查看次数

标签 统计

swift ×1