我正在尝试将类 Wave 的实例添加到我的类 WaveList 实例中
我不知道为什么我不能简单地将它附加到我的测试文件中。
我的课程如下所示:
class Wave {
var name: String
var country: String
var type: String
var left: String
var right: String
var image: String
init(name: String, country: String, type: String, left: String, right: String, image: String){
self.name = name
self.country = country
self.type = type
self.left = left
self.right = right
self.image = image
}
class WaveList{
var waves: [Wave] = []
func addWave(wave: Wave){
self.waves.append(wave)
}
谢谢你