• 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 bug in 10.5.2?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTokenField bug in 10.5.2?


  • Subject: Re: NSTokenField bug in 10.5.2?
  • From: Jim Correia <email@hidden>
  • Date: Wed, 13 Feb 2008 16:36:43 -0500

On Feb 13, 2008, at 4:10 PM, Paul Kim wrote:

I'm currently linking against 10.5 though this app runs on Tiger and has been for some time. I don't recall seeing any differences in behavior on this front between 10.4 and 10.5 (up to 10.5.1). I am running my test program right now linked against the 10.4 SDK on 10.4.11, 10.5.1 and 10.5.2 and 10.5.2 is the odd man out. Switching to the 10.5 SDK, I'm seeing the same behavior (of course, only on the 10.5 machines).

When my app was linked against the 10.4 SDK (and always when running on 10.4), I always got trimmed token values. On 10.5.0-1 I didn't. But I'm not using the token field the same way you are. I'm using the blue appearance tokens, and have the field wired up through bindings.


Playing with your app as is, but changing the token style to the rounded style seems to also avoid the problem. (Which I understand may not be practical depending on your usage.)

I just hacked together a test in my shipping app, and when I link against the 10.4 SDK on 10.5.2, I get the old behavior where the strings are trimmed. Linking against the 10.5 SDK, I get the trimless behavior. (See below.)

You can download my cobbled together test here: http://www.noodlesoft.com/beta/TokenFieldExample.zip

To demonstrate the problem, in the token field, type a space then some characters. Hit tab to shift focus somewhere else. On 10.5.2, the first space will disappear. You can also drag in a token, type a space and some characters and the space will disappear when the field loses focus.

Your example is currently targeting the 10.4 SDK. If you re-target 10.5, and then supply this no-op delegate method, the spaces appear to be preserved.


- (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString:(NSString *)editingString;
{
NSLog(@"Editing string = \"%@\"", editingString);
return editingString;
}


This is crippling the UI for a couple key features of my app. At least if you don't automatically trim the spaces, you can do it manually after the fact. Unfortunately, putting it back is not so easy since you have no idea what whitespace characters were typed in.

In the abstract, I agree. (This was in fact the reasoning Apple engineering gave for the original change, which ended up being a binary compatibility problem for previous versions of my application. The current version does the right thing.)


Jim
_______________________________________________

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


  • Follow-Ups:
    • Re: NSTokenField bug in 10.5.2?
      • From: Paul Kim <email@hidden>
References: 
 >NSTokenField bug in 10.5.2? (From: Paul Kim <email@hidden>)
 >Re: NSTokenField bug in 10.5.2? (From: Jim Correia <email@hidden>)
 >Re: NSTokenField bug in 10.5.2? (From: Paul Kim <email@hidden>)

  • Prev by Date: Re: MD5 check sum of a file
  • Next by Date: how to simulate passing parameter with selector
  • Previous by thread: Re: NSTokenField bug in 10.5.2?
  • Next by thread: Re: NSTokenField bug in 10.5.2?
  • Index(es):
    • Date
    • Thread