本文主要是介绍Smart cast to is impossible, because is a mutable property that could have been changed by this time,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
例如我当前在调用如下方法时候报错,解决方法有两种
lifecycle.addObserver(lifeMc)
解决方法一:重新定义对象类型,但是要确保类型正确
lifeMc as LifeChronometer
解决方法二:延迟加载,不初始化值
这篇关于Smart cast to is impossible, because is a mutable property that could have been changed by this time的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!