-
this class is not key value coding-compliant for the key xxxDevelop/iOS 2021. 8. 29. 23:10
상황
앱 기동시 아래의 에러가 발생
this class is not key value coding-compliant for the key foodListCount
원인
Controller의 Outlet명의 변경 전 값이 스토리보드의 라벨에 연결되어있었기 때문
코드 상황
xxxController.swift
urImCount → foodListLabelCount로 변경한 상태
// urImCount → foodListLabelCount로 변경 @IBOutlet weak var foodListLabelCount: UILabel!
Main.StoryBoard
변경 전 라벨의 이름이 연결되어있다
Main.StoryBoard (여전히 urImCount가 연결되어있다)
해결이미 저질러놓은(?) 상황에서는 연결을 끊었다가 다시 연결해주면 되지만 이런 문제를 간단히 미연에 방지할 수 있는 방법이 있다
변경하고자 하는 변수명을 오른쪽 클릭 → Refactor → Rename
이렇게 변경하면 자동으로 스토리보드에도 반영된다
'Develop > iOS' 카테고리의 다른 글
[xcode] Deployment Target (0) 2022.03.22 NSInvalidArgumentException 발생 (0) 2021.06.19 Deployment Info: iOS Version 변경하기 (0) 2021.06.13