【发布时间】:2019-05-06 13:26:40
【问题描述】:
我想在函数myFunc 中指定用于操作的数组属性,但出现此错误。这是我的代码草图。
self.data = MyObject()
func myFunc(x: inout [Int], y: inout [[Int]]) {
//manipulation code to x and y
}
myFunc(x: &self.data.array1, y: &self.data.array2)
myFunc(x: &self.data.array3, y: &self.data.array4)
知道如何让它工作吗?我应该为这个用例使用更好的模式吗?谢谢提前!
【问题讨论】:
-
什么是self,什么是data?
-
data是自定义类的实例
标签: swift4 shared-memory