Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Builder - Using Layout View-Box

I'm using a Layout View - 'Box' in my application and when i build it, I'm getting the following warning. "Unsupported Configuration. Fill Color property requires NSCustomBox type and NSLineBorder type".I'm using XCode 4.0. What could be the reason and how can i fix it?

Thanks,

LS Developer

like image 740
LS Developer Avatar asked Jul 19 '11 05:07

LS Developer


2 Answers

If I set border color or fill color of a non-custom primary box to anything other than the color IB initializes it as, I get a warning "Border Color Property requires NSCustomBox type and NSLineBorder type"

I can make the warning go away by dragging the 'initial' color from a box in a DIFFERENT project onto the offending color choice in the box's Attribute IB inspector pane.

Fill color changes produce slightly different warning text, but dragging the fill color from a pristine box in another project eliminates that warning as well. Apple seems to have forgotten to put an 'initial value' item in their color choice menus.

like image 104
Wayfaring Stranger Avatar answered Oct 23 '22 09:10

Wayfaring Stranger


Better late than never, but as I was searching, this was the only thread I found describing the matter. Anyway, thanks Wayfaring Stranger, your answer helped me find an alternative fix. Might help someone, since the drag and drop of colors didn't exactly work for me.

  1. Find your box in interface builder and give it a unique name (just temporarily).
  2. Right click your .xib and choose 'open as' > 'source code'.
  3. Do a search for the name you've given your box (or whatever).
  4. You'll 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"/>
    
  5. Remove everything after <bool key="NSTransparent">NO</bool> up to 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>
    
  6. All your warnings for that 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. Search for that number in your .xib source code and remove that line, e.g. <reference key="NSBorderColor2" ref="483112007"/>. In my case, it was just a few lines further down.

Still haven't figured out the cause of the problem though. Never had any warnings setting colors, and this one unexpectedly popped up after accidentally dragging some items in IB.

like image 24
Sebastiaan Luca Avatar answered Oct 23 '22 09:10

Sebastiaan Luca