Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

XCode (4.4) keeps references that are not visible ?

Hi,


I worked on a simple exercise to practice storyboards.

At some time, I had a field called caliberLabel, a label that I create in the nib (in the storyboard) and connected to the .h to create outlet in order to be able to reposition programmatically.

I did work fine.

Later, I decided to change the name caliberLabel in calibreLabel and did by manual editing in all files that references it (.h and .m viewcontroller).

Even though I could not find anymore any reference to caliber in the text, I got the following error at the opening of the iPhone 5.1. simulator.


2012-12-29 20:21:25.148 MasterPact simple[10047:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x683cab0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key caliberLabel.'


Where can this caliberLabel be hidden in my project ?

I also checked the object name in connections editor to delete the reference and rebuild it.


Finally, I had to rebuild a new project, with the same code and everything works fine.


So problem is solved for this time, but I would like to understand what happened to avoid it in the future.


Thanks.

Posted on Dec 29, 2012 11:34 AM

Reply
Question marked as Best reply

Posted on Dec 30, 2012 10:14 AM

Did you update the outlet in the storyboard? The .storyboard file itself defines the outlets. For example, if I have a UITextField on a storyboard with a referencing outlet assigned to the following property in the view controller:


@property (weak, nonatomic) IBOutletUITextField *daysTextField;


The storyboard itself includes the following XML. The destination attribute is the id attribute of the corresponding textField element.


<connections>

<outlet property="daysTextField" destination="5Qm-BG-XG2" id="fip-3z-AA8"/>

</connections>

You probably could have resolved the exception by re-connecting the outlet in the storyboard.

3 replies
Question marked as Best reply

Dec 30, 2012 10:14 AM in response to claudeFromToulouse

Did you update the outlet in the storyboard? The .storyboard file itself defines the outlets. For example, if I have a UITextField on a storyboard with a referencing outlet assigned to the following property in the view controller:


@property (weak, nonatomic) IBOutletUITextField *daysTextField;


The storyboard itself includes the following XML. The destination attribute is the id attribute of the corresponding textField element.


<connections>

<outlet property="daysTextField" destination="5Qm-BG-XG2" id="fip-3z-AA8"/>

</connections>

You probably could have resolved the exception by re-connecting the outlet in the storyboard.

Dec 30, 2012 10:43 AM in response to Llessur999

Thanks,


I had effectively a problem : another label wrongly referenced as caliberLabel outlet to the viewcontroller.


So I erased the reference and rebuilt from the storyboard.

And works (after correcting a second badly referenced Outlet.


Conclusion: when change names in code, I must review carefully all referenced outlets.


Thanks


PS: I replied too quickly "helped", in fact you "solved". Thanks

XCode (4.4) keeps references that are not visible ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.