Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing up/down arrow behavior for NSTextField




On Feb 13, 2008, at 9:58 AM, Joshua Emmons wrote:

You don't want to override these methods directly in your field editor because you might require different behavior for each field in your app and the same field editor is used for all of them. But remember that the text field that is being edited is the field editor's delegate. So you can implement the delegate method - textView:doCommandBySelector: in your text field and do the work there instead.

I have just one thing to add: instead of subclassing NSTextField and overriding textView:doCommandBySelector:, it may be easier to just supply a delegate to the text field and implement the text field delegate method


- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;

instead.

Douglas Davidson

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Changing up/down arrow behavior for NSTextField (From: Duncan Champney <email@hidden>)
 >Re: Changing up/down arrow behavior for NSTextField (From: Joshua Emmons <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.