• 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: textDidChange: for several NSTextFields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: textDidChange: for several NSTextFields


  • Subject: Re: textDidChange: for several NSTextFields
  • From: "Alex Blaj" <email@hidden>
  • Date: Mon, 13 Oct 2008 19:30:14 +0300

Hi Robert,

Thanks for your reply. What I would like to have in this particular case is
a few text fields that, when edited, change the selection of a tableview. So
I wondered if there's a classic approach to this issue, as I can imagine I'm
not the only person that wants to have, for example, several text fields on
a form that react to change. Since I'm new to Mac programming, I thought
maybe there's a Cocoa-style to do it. But thanks anyway, it's good to hear a
second opinion.

Alex

On Mon, Oct 13, 2008 at 5:49 PM, Robert Černý <email@hidden> wrote:

>
>
> 2008/10/13 Alex Blaj <email@hidden>
>
> Hello everyone,
>>
>> A beginners question: I have a window with several NSTextFields and I
>> would
>> like to implement textDidChange: for all of them (the behaviour would be
>> different for each field). What is the "standard" solution for this
>> situation? I can think about either creating a single delegate class for
>> all
>> of them, implement the delegate method once and make checks on the sender,
>> or create a separate delegate class for each of the NSTextFields and
>> implement each one's behaviour separately. If there's already something
>> one
>> the web about this that I missed in my googlings, a link would be
>> appreciated.
>>
>> Thanks,
>> Alex
>
>
> Hell Alex,
> the preferred way depends on the task you're trying to accomplish. I can
> imagine both way you mentioned and both to be correct in different cases. If
> you could find a similar pattern for more textfields you can group them
> under single delegate. I believe it's more question about code readability
> and reusability...
>
> HTH
> Robert
>
_______________________________________________

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: 
 >textDidChange: for several NSTextFields (From: "Alex Blaj" <email@hidden>)
 >Re: textDidChange: for several NSTextFields (From: "Robert Černý" <email@hidden>)

  • Prev by Date: Re: Handler not called on table cell edit
  • Next by Date: Re: NSComboBox, bindings, and auto-complete, oh my!
  • Previous by thread: Re: textDidChange: for several NSTextFields
  • Next by thread: keystroke logger for Mac OS X
  • Index(es):
    • Date
    • Thread