• 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: Working with NSTextFields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Working with NSTextFields


  • Subject: Re: Working with NSTextFields
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 15 Sep 2015 10:20:45 -0700

> On Sep 15, 2015, at 9:11 AM, Alex Hall <email@hidden> wrote:
>
> * When I call myField.stringValue="some text", that string ("some text") appears as expected, but it's highlighted. That means that, when the user starts typing, it disappears, defeating the purpose of the app putting it there for the user in the first place.

That’s the standard behavior for text fields. It lets the user tab through a dialog box and either accept the default value or quickly type in a new one.

> * My field currently doesn't allow spellchecking or auto-correct, but I want it to. I don't see that option anywhere in the inspectors, for the field or its child cell.

This is probably a side effect of the fact that all text fields (and text cells in general) in the window share the same NSTextView, called the “field editor”. So by default they’re using the characteristics of that view.

You can override either of those behaviors, but it sounds like you may want to use an NSTextView instead of an NSTextField in your UI, since its behavior isn’t typical and you want to enable extra features.

—Jens


_______________________________________________

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: Working with NSTextFields
      • From: Alex Hall <email@hidden>
    • Re: Working with NSTextFields
      • From: Alex Hall <email@hidden>
References: 
 >Working with NSTextFields (From: Alex Hall <email@hidden>)

  • Prev by Date: Working with NSTextFields
  • Next by Date: Re: Identifying a specific Mac model
  • Previous by thread: Working with NSTextFields
  • Next by thread: Re: Working with NSTextFields
  • Index(es):
    • Date
    • Thread