老师您好,我将MainViewModel中的属性代理移到main方法中为什么不能用呢,不太明白这个报错提示
class MainViewModel {
val databaseModel: DatabaseModel by ModelDelegate
val networkModel: NetworkModel by ModelDelegate
val spModel: SpModel by ModelDelegate
val spModel2: SpModel by ModelDelegate
}
...
fun main() {
initModels()
val databaseModel: DatabaseModel by ModelDelegate
...
}
提示报错如下