toInt (1) 썸네일형 리스트형 코틀린 String.toInt() Unresolved reference EditText 의 수치값을 Int 변수로 가져오려는 아주 간단한 코드에서 자꾸 Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 에러가 발생했다. 코드는 다음과 같다. val n:Int = binding.editBunja.text.toInt() edit_bunja 에서 text 를 가져와서 toInt 로 정수형으로 바꾸려고 하는데, 왜 에러가 발생하는 걸까 한참을 고민했다. 결론은, editBunja.text 가 String 이 아니라, Editable 이라는 다른 type의 값이어서, 이걸 다시 String 으로 먼저 바꿔 주어야 했다. val n:Int = bind.. 이전 1 다음