Builder Interface - Using the View-Box Layout

I use the Layout View - "Box" in my application, and when I create it, I get the following warning. "Unsupported configuration. Fill Color property requires type NSCustomBox and type NSLineBorder." I am using Xcode 4.0. What could be the reason and how can I fix it?

Thanks,

Developer LS

+4
source share
6 answers

If I set the border color or the fill color of the non-standard main field to anything other than the IB color initializes it as, I get a warning: "The Border Color property requires an NSCustomBox type and an NSLineBorder type"

I can notify the warning by dragging the "initial" color from the window in the DIFFERENT project into the offensive color selection in the "IB Attributes Inspector" field.

Filling color changes creates a slightly different warning text, but dragging the fill color from the untouched frame to another project also removes the warning. Apple seems to have forgotten to put the “seed value” element on its color picker menu.

+4
source

Better late than never, but when I searched, it was the only thread I found describing this question. Anyway, thanks Wayfaring Stranger, your answer helped me find an alternative solution. It might help someone, since dragging and dropping the flowers didn't work for me at all.

  • Find your square in the interface builder and give it a unique name (just temporary).
  • Right-click the .xib icon and choose Open As> Source.
  • Do a search for the name that you entered in the field (or something else).
  • You will find something like this:

    <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67108864</int> <int key="NSCellFlags2">0</int> <string key="NSContents">uniqueNameHere</string> <reference key="NSSupport" ref="26"/> <reference key="NSBackgroundColor" ref="449986353"/> <object class="NSColor" key="NSTextColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes> </object> </object> <reference key="NSContentView" ref="183372649"/> <int key="NSBorderType">0</int> <int key="NSBoxType">0</int> <int key="NSTitlePosition">0</int> <bool key="NSTransparent">NO</bool> <bool key="NSFullyTransparent">YES</bool> <real value="0.0" key="NSBorderWidth2"/> <object class="NSColor" key="NSBorderColor2" id="483112007"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">textColor</string> <reference key="NSColor" ref="703464901"/> </object> <reference key="NSFillColor2" ref="483112007"/> 
  • Delete everything after <bool key="NSTransparent">NO</bool> until the next </object></array> , leaving you with:

     <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67108864</int> <int key="NSCellFlags2">0</int> <string key="NSContents">uniqueNameHere</string> <reference key="NSSupport" ref="26"/> <reference key="NSBackgroundColor" ref="449986353"/> <object class="NSColor" key="NSTextColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes> </object> </object> <reference key="NSContentView" ref="183372649"/> <int key="NSBorderType">0</int> <int key="NSBoxType">0</int> <int key="NSTitlePosition">0</int> <bool key="NSTransparent">NO</bool> 
  • All your warnings for this item will disappear, except for one: This archive contains a reference to an object with the identifier "483112007" but does not contain an object with a matching identifier. Find this number in the .xib source code and delete this line, for example. <reference key="NSBorderColor2" ref="483112007"/> . In my case, it was just a few lines further.

However, they have not yet figured out the cause of the problem. There have never been warnings about adjusting colors, and this one appeared unexpectedly after accidentally dragging some items into IB.
+3
source

I decided to drag the colors from the NSBox to a new project, as Wayfaring Stranger suggested. If you want to manually modify XIB, change (I am on Xcode 5.0.2):

Deleted (your values ​​will probably be different that the "default color":

 - <color key="borderColor" name="textColor" catalog="System" colorSpace="catalog"/> - <color key="fillColor" name="textColor" catalog="System" colorSpace="catalog"/> 

Replaced by:

 + <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> + <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> 

Of course, in the relevant section. XIB - version 5.

+1
source

Based on Jonas answer, I managed to fix my warnings by searching for NSTransparent in the .xib file:

Right click or select ctrl-click.xib and select "Open As → Source Code"

Search for NSTransparent to find something similar to:

 <bool key="NSTransparent">NO</bool> <object class="NSColor" key="NSFillColor2"> <int key="NSColorSpace">1</int> <bytes key="NSRGB">MSAwLjgwMDAwMDAxMTkgMC40MDAwMDAwMDYgMC4wNAA</bytes> </object> 

Then I deleted <object class="NSColor" in </object> inclusive, and there were no more warnings.

0
source

I just solved the problem by choosing Custom from Box Type in IB. This made the message go away immediately.

At first I was puzzled by the message, since I did a similar thing (namely, changed the background color of the NSBox) to white in another project. But then I remembered that I also changed Type Box. And that did the trick.

0
source

Since my drawer was just cosmetic, I created a new box, moved the buttons in the old window to a new box, and deleted the old window. The end of the problem.

0
source

All Articles