• 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: Identifying NSTextViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying NSTextViews


  • Subject: Re: Identifying NSTextViews
  • From: Andy Lee <email@hidden>
  • Date: Wed, 29 Jul 2009 01:15:07 -0400

On Jul 29, 2009, at 1:02 AM, Graham Cox wrote:
On 29/07/2009, at 2:54 PM, Rippit the Ogg Frog wrote:

My problem isn't getting a pointer to one of the NSTextViews. My problem is figuring out which of those NSTextViews a given pointer refers to.


It's trivial.

Make an outlet for each text view and hook it up in IB. Then do a if([notification object] == myTextViewA)... type of thing. This is by far the easiest way to identify things - the object's pointer is its identity.

Note this means you *could* gather the text in textDidChange: instead of or in addition to the approach I suggested. Depending on your app, you might decide you want to do this -- I didn't mean to imply it was a bad idea.


--Andy


_______________________________________________

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: 
 >Identifying NSTextViews (From: Rippit the Ogg Frog <email@hidden>)
 >Re: Identifying NSTextViews (From: Graham Cox <email@hidden>)
 >Re: Identifying NSTextViews (From: Rippit the Ogg Frog <email@hidden>)
 >Re: Identifying NSTextViews (From: Graham Cox <email@hidden>)

  • Prev by Date: NSArrayController subclass computed property not being updated
  • Next by Date: Re: Identifying NSTextViews
  • Previous by thread: Re: Identifying NSTextViews
  • Next by thread: Re: Identifying NSTextViews
  • Index(es):
    • Date
    • Thread