TODO("not implemented")抛异常
2018-04-25 本文已影响0人
花花是男神
在kotlin实现接口的时候小白可能会遇到以下异常:
抛出异常:kotlin.NotImplementedError: An operation is not implemented: not implemented
在实现接口的时候IDE会自动为我们添加上:
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
“TODO("not implemented")”这句代码,这句代码在运行的时候会抛出以上异常,这样做的好处是促使我们去实现接口方法或者手动删掉这句代码。
解决这个异常的方法就是删掉这行代码