问题
I recently upgraded to xcode 5.0.2
Now, I'm getting this warning when I build my Cocoa app:
Attribute Unavailable Use Current Width For Max Layout Width on Mac OS X version prior to 10.8
I tried to locate 'Max Layout Width' but I wasn't able to.
How do I get rid of this warning?
回答1:
In Xcode 5.1, uncheck the "First Runtime Layout Width" checkbox in the NSTextField
's attributes inspector to remove the warning.
回答2:
markhunte's answer should give you the background, but in my case there simply wasn't a checkbox for Use First Layout Width As Max for any of my controls. However, in the .xib one text label had:
setsMaxLayoutWidthAtFirstLayout="YES"
Setting it to NO gets rid of the warning.
回答3:
I suspect this is due to "Auto Layout"
Auto Layout is a system that lets you lay out your app’s user interface by creating a mathematical description of the relationships between the elements
You can Turn it off. But I think if you already upgraded the .xib to use the new xcode 5 IB. Then you may still get the warnings.
You can turn off "Use First Layout as Width as Max" which may be all you need to do. If you click on one of the warnings it will take you to the element with the issue. In the Inspector you may see:
which you can uncheck.
To turn it off Autolayout:
Select your .xib file in the Project Navigator.
And in the Identity and Type Inspector.
Uncheck "Use Autolayout"
But it may be better to look at the Apple Doc for Auto Layout and Particularly read Adopting Auto Layout which should help you to adjust your project ( I actually need to read this myself :-) )
来源:https://stackoverflow.com/questions/20103606/upgrading-to-xcode-5-0-2-xib-warning-attribute-unavailable