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 (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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to