[Debug๐Ÿ”ง] class is not key value coding-compliant for the key __

Lilyยท2021๋…„ 12์›” 11์ผ
0
post-custom-banner

๐Ÿ‘พ Erorr

Thread 1: "[<UIViewController 0x7fbd7a00d3a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key table."

ํ•ด๊ฒฐ๋ฐฉ๋ฒ• 1

IBOutlet์˜ ๊ธฐ์กด ์Šคํ† ๋ฆฌ๋ณด๋“œ์™€์˜ ์—ฐ๊ฒฐ์„ ๋Š์–ด์ฃผ์ง€ ์•Š๊ณ 
์ด๋ฆ„์„ ๋ณ€๊ฒฝํ•ด์ฃผ์—ˆ์„ ๋•Œ ์ƒ๊ธฐ๋Š” ์˜ค๋ฅ˜์ด๋‹ค.

์Šคํ† ๋ฆฌ๋ณด๋“œ์˜ UI์š”์†Œ๋ฅผ ๋ทฐ์ปจํŠธ๋กค๋Ÿฌ์— IBOutlet๋ณ€์ˆ˜๋กœ ์—ฐ๊ฒฐํ•ด์ค„ ๋•Œ,
์Šคํ† ๋ฆฌ๋ณด๋“œ์˜ XMLํŒŒ์ผ ์ฝ”๋“œ์— ์—ฐ๊ฒฐ๊ด€๊ณ„์— ๋Œ€ํ•œ ์ฝ”๋“œ๊ฐ€ ์ƒ์„ฑ๋œ๋‹ค.
๋”ฐ๋ผ์„œ ํ•ด๋‹น์ฝ”๋“œ๋ฅผ ์‚ญ์ œํ•˜์ง€ ์•Š์œผ๋ฉด ์•„๋ฌด๋ฆฌ ์ƒˆ๋กœ์šด ๋ณ€์ˆ˜๋ช…์„ ์ง€์ •ํ•ด์ค˜๋„ ์ฐพ์ง€๋ชปํ•œ๋‹ค.

// XML ํŒŒ์ผ
<conection>
	<outlet property = "image"
</connection>

๊ธฐ์กด์˜ ์—ฐ๊ฒฐ๊ด€๊ณ„๋ฅผ connection inspector ํƒญ์—์„œ ์‚ญ์ œํ•ด์ฃผ๋ฉด
XMLํŒŒ์ผ์˜ ์—ฐ๊ฒฐ ์ฝ”๋“œ๋„ ์‚ญ์ œ๋œ๋‹ค.

๐Ÿ’กIBOutlet ์ˆ˜์ •ํ•  ๋•Œ๋Š” ๊ธฐ์กด ์—ฐ๊ฒฐ์„ ๋จผ์ € ๋Š๊ณ  ํ•˜์ž!


ํ•ด๊ฒฐ๋ฐฉ๋ฒ• 2

IBOutlet ๋ณ€์ˆ˜์™€ ์Šคํ† ๋ฆฌ๋ณด๋“œ์˜ ์—ฐ๊ฒฐ๊ด€๊ณ„๋ฅผ ๋ชจ๋‘ ํ™•์ธํ•ด์ฃผ์—ˆ๋Š”๋ฐ๋„
์—ฌ์ „ํžˆ ์—๋Ÿฌ๊ฐ€ ๋‚จ์•„์žˆ์—ˆ๋‹ค.

๊ฒฐ๋ก ์ ์œผ๋กœ ๋งํ•˜๋ฉด ์Šคํ† ๋ฆฌ๋ณด๋“œ์˜ viewController์˜ Identity Inspector ํƒญ์—์„œ Inherit Module From Target์„ ์ฒดํฌํ•ด์คŒ์œผ๋กœ์จ ํ•ด๊ฒฐํ–ˆ๋‹ค.

ํƒ€๊ฒŸ์˜ ๋ชจ๋“ˆ์„ ์ƒ์†๋ฐ›์œผ๋ฉด viewController class๊ฐ€ table ๋ณ€์ˆ˜๋ฅผ ์ฝ”๋”ฉํ•˜๊ธฐ ์œ„ํ•œ key value๊ฐ€ ๋œ๋‹ค๋Š” ๊ฒƒ์œผ๋กœ ์ดํ•ดํ–ˆ๋Š”๋ฐ...

์•„์ง ์ž˜ ๋ชจ๋ฅด๊ฒ ๋‹ค.

XMLํŒŒ์ผ์˜ ์ƒ์„ฑ๊ณผ ๋ณ€๊ฒฝ์‹œ์ ๋„ ์ •ํ™•ํ•˜๊ฒŒ ์ดํ•ดํ•˜์ง€ ๋ชปํ–ˆ๊ตฌ...
์ข€ ๋” ํƒ๊ตฌํ•ด๋ณผ ์ฃผ์ œ๋กœ ๋‚จ๊ฒจ๋‘๊ณ  ์šฐ์„ ์€ ํฌ์ŠคํŒ… ๋งˆ๋ฌด๋ฆฌ...!

  • ์Šคํ† ๋ฆฌ๋ณด๋“œ์™€ XMLํŒŒ์ผ๊ฐ„์˜ ๊ด€๊ณ„... ๋ฌด์—‡์ด ๋จผ์ € ์„ ํ–‰๋˜๋Š”๊ฐ€?

๐Ÿ’ป ์ฐธ๊ณ ๋ธ”๋กœ๊ทธ
Becodable_ Fixing "This Class is not Key Value Coding-Compliant for the Key" Error In Xcode

profile
i๐ŸŽS ๊ฐœ๋ฐœ์„ ํ•ฉ๋‹ˆ๋‹ค
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€