我正在将Swift与领域一起使用。我想做这样的事情
var objectsTypes:[Object.Type] = [Test.self, Test2.self]
let realm = try! Realm()
let temps = try! realm.objects(objectTypes[0].self)
或
let temps = try! realm.objects(objectTypes[0])
如果可以的话,是否可能以错误的方式或即时消息呢?
答案 0 :(得分:0)
尝试一下:
let objectsTypes: [Object.Type] = [Test.self, Test2.self]
let realm = try! Realm()
let temps = try! realm.objects(objectTypes[0])