Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress Xcode "Attribute Unavailable" warning in XIB file?

My App is targeted to 10.6 and the "Deployment" value for all .xib files was 10.6 apart from one, which recently changed to 10.7 (I don't know when). If I change it back to 10.6 I get the following warning from Xcode:

/Users/andy/Source/.../Preferences.xib:383: Identifier on OS X versions prior to 10.7

Here is the relevant part of the .xib file:

381: <string key="NSFrame">{{1, 1}, {116, 104}}</string>
382: <reference key="NSSuperview" ref="14642427"/>
383: <reference key="NSNextKeyView" ref="1001986100"/>
384: <string key="NSReuseIdentifierKey">_NS:11</string>

(In fact when I open the .xib in BBEdit in order to see the warning line and then close it and clean/build in Xcode, the line being warned seems to change; it's always 383 however the content moves. The last time the warning happened it was the NSSuperview line that was on line 383, which is weird to say the least).

Sometimes I get two warnings. The other warning is:

file://localhost/Users/andy/Source/.../Preferences.xib: warning: Attribute Unavailable: Identifier on OS X versions prior to 10.7

Which highlights a custom view in the .xib file when I click on it.

Can anyone tell me what this warning means and how I get rid of it?

I am developing under 10.8 using Xcode 4.4.1 and I reckon this warning will cause issues when running under 10.6 (something I cannot do during development). I am happy to provide additional info, as required.

like image 318
trojanfoe Avatar asked Jan 16 '23 16:01

trojanfoe


1 Answers

To remove it:

1) Select the XIB file (editor opens)

2) Press cmd+opt+3 to open the Identity Inspector for the XIB in question. Then press the warning in the warning navigator -- which should select the offending object in the NIB editor.

3) Clear the value in Identity > Identifier (just below the field where you would specify a custom class)

4) Save and Build.

That should do it.

What it means:

You are using a document feature which is not supported by 10.6.

Specifically, it appears this key/value is associated to @protocol NSUserInterfaceItemIdentification:

The NSUserInterfaceItemIdentification protocol is used to associate a unique identifier with objects in your user interface. The protocol is adopted by AppKit interface objects to support window restoration, whereby information about window and other interface-related objects is preserved and used to restore the application’s interface during the next launch cycle.

The key to search for in the XIB is userInterfaceItemIdentifier.

like image 144
justin Avatar answered Jan 31 '23 03:01

justin