• 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: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField


  • Subject: Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField
  • From: Aki Inoue <email@hidden>
  • Date: Wed, 21 Sep 2011 23:07:59 -0700

Actually, the most of functionality provided by the UITextField method is better implemented by a formatter subclass with NSTextField.

Aki Inoue


On 2011/09/21, at 19:49, Jens Alfke <email@hidden> wrote:

>
> On Sep 21, 2011, at 7:42 PM, Eric Wing wrote:
>
>> I have been using the delegate callback
>> textField:shouldChangeCharactersInRange:replacementString for
>> UITextField.
>> I am trying to port code over to Mac using NSTextField. Is there
>> something that provides similar functionality?
>
> Yes, but it’s a bit more complicated due to some rough edges in the AppKit API that got cleaned up in iOS. The delegate method you’re looking for is in NSTextView, which is the actual view used to manage editing in a focused NSTextField. Basically, you should read about “field editors” in the AppKit docs. You’ll want to give your text field a custom field editor and set yourself as its delegate.
>
> ―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
_______________________________________________

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

References: 
 >Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField (From: Eric Wing <email@hidden>)
 >Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Passing NSPrintOperation* to CPP Function
  • Next by Date: Open panel/window with button click in Print Dialog Extension (PDE)
  • Previous by thread: Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField
  • Next by thread: Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField
  • Index(es):
    • Date
    • Thread