• 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: Custom field editor on NSSecureTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom field editor on NSSecureTextField?


  • Subject: Re: Custom field editor on NSSecureTextField?
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 16 Jun 2008 19:29:41 -0600


On Jun 16, 2008, at 7:16 PM, John Stiles wrote:

I've got some code which subclasses NSTextView in order to provide a custom
field editor for NSTextFields. It doesn't do anything too extraordinary,
just allows for filtering out some characters, watching for certain events
(like deleting characters or changing the selection), etc. It all works
quite well.
Now, it looks like I need to do the same thing with an NSSecureTextField.
Now, digging around, it looks like its field editor is an
NSSecureTextView--which isn't documented or in the headers, AFAICS. Since
it's undocumented, I don't think there is a way I can subclass it.


So is it just not possible to customize the field editor for a secure text
field? :|


Well, you could write your own header for the class and then subclass it, but then you'll have to work whatever magic is necessary to get NSSecureTextField to actually use it, since - windowWillReturnFieldEditor:toObject: isn't called for special text fields. That includes NSTokenField, which also uses its own special & private field editor.

Ultimately, though, this is really hackey and probably shouldn't be done. You can, however, do what you're trying to do with an NSFormatter subclass instead.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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: Custom field editor on NSSecureTextField?
      • From: "John Stiles" <email@hidden>
References: 
 >Custom field editor on NSSecureTextField? (From: "John Stiles" <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: Re: (no subject)
  • Previous by thread: Custom field editor on NSSecureTextField?
  • Next by thread: Re: Custom field editor on NSSecureTextField?
  • Index(es):
    • Date
    • Thread