4
votes

I have a view based NSTableView whose content is bound to an array controller. I bind one specific text field using objectValue.title. This works fine. I also have set a null placeholder for that binding which is indeed displayed when the value is null. However, it does NOT use translated values of the null placeholder.

The identifier for the placeholder is je1-iU-XEu.ibShadowedIsNilPlaceholder and the corresponding translation is je1-iU-XEu.ibShadowedIsNilPlaceholder" = "Stationsname";. If I do the same with a cell based table view, it works. Any idea why this is not working?

Cell Binding

1
Same problem here. Did you ever find a solution for this?Mark
@Mark No. I think it is a bug somewhere in AppKit. I didn't try it with Xcode 6.3 though. It might be a good idea to file a radar.Sbhklr
I just wrote a little sample project to reproduce this. This only seems to happen for an outline view. A placeholder for an NSButton works. I'll file a bug report as soon as radar is back online.Mark
Workaround is to use an "Interface Builder Cocoa XIB" instead of "Localized Strings" file for the translated file.Mark
This still doesn't work in Xcode 7.3.DanielGibbs

1 Answers

0
votes

I'm having this bug today. Seems that Apple didn't care about fixing it.

If you use localized strings, then you might have to dive in the storyboard code and ensure the object ids are matching.

In your storyboard, you will see an element with key "NSNullPlaceholder", wrapped into another one with id "Ds1-Gj-yzu". (See the code below)

Go to your string file and ensure you have something like

"Ds1-Gj-yzu.ibShadowedIsNilPlaceholder" = "Your translation";

WARNING: each time you will change the placeholder value in the storyboard, a new ID is generated, breaking at the same time the localization.

<connections>
    <binding destination="TyA-Z9-mxH" id="Ds1-Gj-yzu" keyPath="objectValue.group" name="value">
        <dictionary key="options">
            <string key="NSNullPlaceholder">Group</string>
        </dictionary>
    </binding>
</connections>