"this class is not key code compatible with the key ..."

over the past few days, I keep getting this error every time I run the build in xCode:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x1dd4a1c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key playBtn.' 

in the beginning he was in something that I did. than I deleted it, and it was still there - in an object (like this playBtn here) that no longer existed.

and now - in every application that I am trying to debug. if on my iphone or in the simulator - the same thing.

Now I just can't run anything !!

* clean does not work! *

What am I doing? I can’t work like that.

notice: resolved. it was a problem with appdelegate.m thanks for the help.

-1
source share
4 answers

I solved it.

this was a problem with appdelegate.m with uitabbar.

Thanks, who helped, and those who tried :)

0
source

Check IBOutlet connections in XIB

You said that playBtn does not exist, so check if there is a connection for the same one, they will show! mark instead of a point in the joints.

enter image description here

+2
source

I bet you have a File Owner file confused with your xib. One of your views is configured as the playBtn the file owner. However, when it is time to unlock nib, the owner does not have the playBtn property, so unpacking does not work.

Two things you can do:

1) Check the Connection Inspectors tab for the view that is causing the error. Remove all output connectors and reconnect all sockets.

2)

enter image description here

GoodLuck !!!

+1
source

The problem is that you are indirectly (presumably when one of your feathers is unpacked) by calling -setValue:forKey: on a UIApplication .

You can reproduce this problem by creating a new empty iPhone project and adding the following line to the app delegate -application:didFinishLaunchingWithOptions:

 [[UIApplication sharedApplication] setValue:[[UIButton alloc] init] forKey:@"playBtn"]; 

Without a backtrace or even a full log, this is difficult to do, but it is likely that you have the same problem as described here .

+1
source

Source: https://habr.com/ru/post/1482769/


All Articles