• 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: NSTokenField, how to query the selection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTokenField, how to query the selection?


  • Subject: Re: NSTokenField, how to query the selection?
  • From: Tim Gogolin <email@hidden>
  • Date: Tue, 2 May 2006 15:57:53 -0500

On May 2, 2006, at 2:08 PM, Tim Gogolin wrote:
How do I get the current selected range of a NSTokenField?

Use -[NSWindow fieldEditor:forObject:] to get its field editor. Then you can get the selected range from the field editor.


Nick Zitzmann
<http://www.chronosnet.com/>

Thanks for the reply, Nick. Would that it were so.
But fieldEditor:forObject: seems to return a field editor that has no knowledge of TokenFields at all. A little grepping of the web seems to point at +[NSTokenFieldCell _sharedFieldEditor] as an undocumented way to actually get the field editor that is actually being used.


Calling selectedRange: on that object gets me a range that makes sense... (each token basically counts as "one letter" in the selected range).

So I guess I've solved my problem... but there's a reason people don't document some interfaces... Sigh.
Does anyone know a better supported way to do this?


--
Tim Gogolin
Adobe Systems
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTokenField, how to query the selection?
      • From: Nick Zitzmann <email@hidden>
References: 
 >NSTokenField, how to query the selection? (From: Tim Gogolin <email@hidden>)
 >Re: NSTokenField, how to query the selection? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Refactoring tools available for Cocoa / ObjC?
  • Next by Date: NSString intValue
  • Previous by thread: Re: NSTokenField, how to query the selection?
  • Next by thread: Re: NSTokenField, how to query the selection?
  • Index(es):
    • Date
    • Thread