[UIKit] error: this class is not key value coding-compliant for the key.


[UIKit] error: this class is not key value coding-compliant for the key.

에러는 appdelegate.swift에서 발생하지만 여기 코드는 건든 적이 없다. 그러면 ViewController.swift에서 영향을 준 건데 다른 곳(RN 등)과 달리 여기는 항상 스토리보드를 확인해 줘야 한다. UIButton으로 IBOutlet을 연동했고 buttonTest라는 함수를 만들었다. 그리고 어떤 이유든지 이 코드를 지웠다. 직후 위 에러가 발생한다. Referencing Outlets에 'buttonTest'가 남아있으므로 지워줘야 한다. 문제 해결. 에러 위치 찾기 본인이 어떤 작업을 한 직후 에러가 발생했는지 명확하면 문제가 해결되지만, 그렇지 않으면 에러 발생한 위치를 찾아야 한다. Main.storyboard 우클릭 -> Open As -> Source Code xml 파일이 열린다. 단어 찾기로 에러를 일으킨 단어를 찾으면 위치가 나온다. 해당 부분을 찾아가서 스토리보드를 지운다....


#appdelegate #compliant #error #storyboard #viewcontroller #xml

원문링크 : [UIKit] error: this class is not key value coding-compliant for the key.