Re: Placeholder text on a multi-line NSTextField
Thanks. That got me pointed in the right direction. Setting the placeholder string to nil in control:textShouldBeginEditing clears the stray second line away nicely. Setting it back in control:textShouldEndEditing appears to prevent editing from actually ending. Setting it back in the control's action works, though. I do now see the reverse problem when the user clears the text; the first line of the old placeholder string appears even after it's been set to nil. I'm much less concerned about this, though, because while populating this field is something a user will do every time they create a new document in this application, clearing it should be comparatively rare. Thanks again for your help. Regards, Geoff On Wed, Feb 29, 2012 at 5:01 PM, Ross Carter <rosscarterdev@me.com> wrote:
Use the delegate method control:textShouldBeginEditing: to set the placeholder string to nil when editing begins, and control:textShouldEndEditing: to restore the placeholder if the text field is empty?
On Feb 29, 2012, at 1:23 PM, Geoff Beier wrote:
I've opened radar #10954811 about the appearance of placeholder text in a multi-line NSTextField. If the placeholder is sufficiently long, when a user clicks the field and starts typing, only the first line of placeholder text gets cleared until the edit is finished.
I ran across this while picking up a project that I hadn't worked on since before the Lion upgrade. This would seem to be new behavior in Lion.
Here is a trivial sample project that demonstrates the problem: https://downloads.redhoundsoftware.com/listshare/PlaceholderTest.zip
Does anyone know a way to work around this?
Thanks for any insight.
Regards,
Geoff _______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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: https://lists.apple.com/mailman/options/cocoa-dev/rosscarterdev%40me.com
This email sent to rosscarterdev@me.com
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Geoff Beier