这就是我们所拥有的。这是斯威夫特代码:为什么我不能将我的类方法定义为包含变量的索引实例数组?
class Process {
// Some methods and properties
}
class SomeClass {
var list: [Process]? = nil
// ...
func someFunc() {
// ...
if list !=nil {
for i in list! {
if list[i].
}
}
插入在最后一行点(.
),我不明白的方法和属性的列表。
如果我改变指数i
到数字的话,我会得到的方法和它的类工艺属性的列表 How it's look like
我应该怎么做索引使用变量我可以使用的方法它的课?
P.S.对不起,我使用机器翻译
非常感谢您的回答! –