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

NSTokenField


  • Subject: NSTokenField
  • From: Guy English <email@hidden>
  • Date: Fri, 26 Aug 2005 14:50:42 -0400

Hi everyone,

    NSTokenField is ... annoying me. First it doesn't seem like you can size it any higher than one line and have it work correctly. Second I can't seem to find a way to programmatically insert tokens. [tokenField setStringValue: @"this, is, annoying"] doesn't tokenize the string. Ditto for the value binding. Further if I click in the field and edit it it *also* doesn't tokenize the string. Unless I press Enter with the insertion point over each token in turn.

   And then, wanting to make sure I'd covered the bases before bitching publicly, I checked the release notes ...

"Use NSControl/NSCell's setObjectValue: method to set the token field's array of represented objects. If the array contains objects other than NSStrings, you must implement the tokenField:displayStringForRepresentedObject: delegate method."

    So, ok, mea culpa. I can't try this right now but I assume it works perfectly. A couple of things are annoying about this though. First, it'd be nice to document the behaviour of setObjectValue in the NSTokenField docs (radar 4233801). Second, and this may be debatable, the 'value' binding doesn't do what you likely want it to do. And there is no 'objectValue' binding exposed.

    Anyway, I wasn't going to send this mail after I found the Release Notes but I think it's worth having in the archives in case anyone else is struggling with this.

Take care,
Guy
 _______________________________________________
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
      • From: Scott Anguish <email@hidden>
  • Prev by Date: How to access stand-alone month name with NSDateFormatter
  • Next by Date: Re: How to access stand-alone month name with NSDateFormatter
  • Previous by thread: Re: How to access stand-alone month name with NSDateFormatter
  • Next by thread: Re: NSTokenField
  • Index(es):
    • Date
    • Thread