• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder


  • Subject: Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 29 Dec 2012 14:16:32 -0800

On Dec 29, 2012, at 7:22, Keary Suska <email@hidden> wrote:

> Anything else you can think of?

Well, I have part of the answer. I think there are 2 bugs, though it's not entirely clear.

AFAICT, the reason it's showing the No Selection placeholder is roundabout. It *isn't* displaying the No Selection placeholder as a result of the binding. It's actually displaying the Placeholder String of the *text field* (when you delete the contents after there's initially been something there), but when you originally created the binding Xcode changed the Placeholder String in the text field to the No Selection string from the binding. At least, that's what happened to me.

This appears to be a bug in Xcode, and it only happened when I first established the binding. After that, playing with the binding placeholders didn't have any effect on the text field Placeholder String. (However, Xcode did crash dramatically one time, right after I changed a binding placeholder and tried to select the text field. That seems relevant.)

The second bug (I think) is that the field editor displays the text field Placeholder String at first (i.e. when you delete the contents after there's initially been something there), but the appropriate binding placeholder at other times. I still suspect this is a timing issue with NIB loading, where the text field caches the placeholder it's going to tell the field editor to use before it's seen that there's going to be a binding that supplies a different placeholder.

The workaround for the first bug (which would make the second bug moot) is to change the text field Placeholder String to match the binding's Null placeholder. Of course, that means you'll still have to go in and edit (or at least check) each text field in Xcode.

I dunno about  a workaround for the second bug (which would make the first one moot, I suppose). Perhaps if your could arrange to re-set the text field to its initial value after the window has been displayed, the field editor problem would go away. Or perhaps you'd have to to set it to the empty string or nil, before you re-set it to the correct thing. Or perhaps you'd have to re-set it before the field editor is created.

The controller has no role in any of this. In my testing, I didn't even use one,

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
      • From: Keary Suska <email@hidden>
References: 
 >Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder (From: Keary Suska <email@hidden>)
 >Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder (From: Quincey Morris <email@hidden>)
 >Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
  • Next by Date: Refreshing the NSOpenPanel?
  • Previous by thread: Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
  • Next by thread: Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
  • Index(es):
    • Date
    • Thread