-1

for the past few days i keep on getting this error everytime i run a 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.'

at the begining it was in something i have made. than i deleted it and it was still there - in an object (like this playBtn here) that did not exist anymore.

and now - in every single app i am trying to debug. if on my iphone or in the simulator - the same.

i just can't run anything now !!

*clean doesn't work ! *

what do i do? i can't work like this..

notice: solved. it was a problem with the appdelegate.m thanks for who helped.

Eliran Efron
  • 621
  • 5
  • 16
  • 1
    something is trying to access the @property review you `IBOutlet` connections. – Buntylm Jun 03 '13 at 10:44
  • 2
    check http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key – kirti Chavda Jun 03 '13 at 10:46
  • @kirtimali saw it.. nothing helped... – Eliran Efron Jun 03 '13 at 10:53
  • @bit-whacker i did, nothing is wrong with it. also thing that used to work, untouched - makes the same error. – Eliran Efron Jun 03 '13 at 10:53
  • You wrote "and now - in every single app i am trying to debug." Do you mean that for example if you create a new empty iPhone app and run it, you will still get this problem? – Nate Chandler Jun 03 '13 at 11:03
  • yes, in things that are not connected. id don't get the error for the key of the other one, it is just that i get that error for some object i have in the new one. – Eliran Efron Jun 03 '13 at 11:06
  • I'm trying to identify whether this is an Xcode issue that you've identified, or if your xib files are incorrectly configured. When you create a brand new project and run it immediately without making any changes whatsoever, do you still get this behavior? – Nate Chandler Jun 03 '13 at 11:21
  • It would be helpful if you added an exception breakpoint and copied the backtrace into your question. – Nate Chandler Jun 03 '13 at 11:23
  • [This](http://petosoft.wordpress.com/2012/01/31/key-value-horrors-and-nibxib-uiapplication-setvalueforundefinedkey-this-class-is-not-key-value-coding-compliant-for-the-key-setvalueforundefinedkey-this-class-is-not-key-value/) may prove useful. – Nate Chandler Jun 03 '13 at 11:39
  • @EliranEfron: In that case, you should add your solution as an Answer and mark it as accepted instead of Editing the Question. – Bhavin Jun 07 '13 at 09:15

4 Answers4

2

Check your IBOutlet connections in your XIB

You said playBtn does not exists, so check if connection still exist for the same, They will show ! mark in place of dot in connections.

enter image description here

DivineDesert
  • 6,924
  • 1
  • 29
  • 61
1

I bet that You've got your File's Owner stuff messed up in your xibs.One of your views is set up to be the playBtn of the the File's Owner. However, when it's time to unarchive the nib, the owner doesn't have an playBtn property, so the unarchiving is failing.

Two Things you can do :

1) Check your "Connections Inspector" tab for the view that's throwing the error. Remove all the Outlet Connections and re-connect all the Outlets.

2)

enter image description here

GoodLuck !!!

Bhavin
  • 27,155
  • 11
  • 55
  • 94
  • done that and it is still not working... can it be a problem with my xcode? – Eliran Efron Jun 03 '13 at 11:39
  • @EliranEfron: Ofcourse not. try to create simple application with some buttons and labels and check if it works or not. – Bhavin Jun 03 '13 at 11:40
  • ok i just made something and it worked but how do i fix it in my project? – Eliran Efron Jun 03 '13 at 11:49
  • all my old projects can't run ! even if they did before – Eliran Efron Jun 03 '13 at 11:49
  • @EliranEfron: If you are creating something new and it's working that means problem is not with your Xcode. Shocking to know that your Old Projects not working !!! In that case , you have to re-install your Xcode. – Bhavin Jun 03 '13 at 11:51
1

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

You can reproduce this issue by creating a new empty iPhone project and adding the following line to your app delegate's -application:didFinishLaunchingWithOptions:.

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

Without a backtrace or even a complete log, it's hard to be sure, but it looks quite likely that you are having the same issue that is described here.

Community
  • 1
  • 1
Nate Chandler
  • 4,533
  • 1
  • 23
  • 32
0

I solved it.

it was a problem with the appdelegate.m with the uitabbar.

thanks for who helped and those who tried :)

Eliran Efron
  • 621
  • 5
  • 16