Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class is not key value coding-compliant for the key

Tags:

ios

storyboard

My app crashes on launch with the following error:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tableViewChannels.

This is a project that I've inherited and re-worked significantly. I thought initially that tableViewChannels was an old array, but I've searched the whole project in XCode and it doesn't appear anywhere.

I went into the storyboard with my favorite text editor to look at the raw XML, and did indeed find two instances of "tableViewChannels" which appear to have been old IBOutlets (they no longer actually appear in the visual storyboard). I deleted both, saved, cleaned the build folder, restarted XCode, and still crash with exactly the same error. I'm perplexed as to where this code is still lurking in the project. I appreciate any help. Thanks!

like image 969
Reid Avatar asked Feb 15 '23 02:02

Reid


1 Answers

i am not entirely sure but this issue might be cause in your storyboard/xib there must be an IBOutlet which was earlier connected variable but later this variable was removed.. please go through each xib and see if u have this.. else a better way is.. type "tableViewChannels" in xcode.. select the word any try to refractor it.. this will list all the files its going to refactor.. including xibs. :) this way u can be sure if tableViewChannels is there in any of ur xibs

like image 129
dRAGONAIR Avatar answered Feb 27 '23 19:02

dRAGONAIR