Re: NSTokenField bug in 10.5.2?
Re: NSTokenField bug in 10.5.2?
- Subject: Re: NSTokenField bug in 10.5.2?
- From: Paul Kim <email@hidden>
- Date: Wed, 13 Feb 2008 16:10:45 -0500
Hi Jim,
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).
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.
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.
What I'd like to know is what voodoo the date/time format editor in
SysPrefs is using to avoid this.
Paul Kim
On Feb 13, 2008, at 3:49 PM, Jim Correia wrote:
On Feb 13, 2008, at 2:43 PM, Paul Kim wrote:
It appears the behavior of NSTokenField has changed in 10.5.2. It
now trims any space around any tokens. This includes plain style
tokens (which look just like regular strings).
Are you linking against the 10.4 or 10.5 SDK?
I previously ran into the reverse problem NSTokenField automatically
trimmed trailling and leading whitespace in 10.4, so I was surprised
to see the spaces appear in 10.5. (And it did represent a binary
compatibility problem for my application.)
I've since implemented the appropriate delegate methods to ensure
the trimming happens if necessary.
I'm having problems figuring out a workaround as every delegate/
notification method already has the spaces trimmed off before I can
get to them.
It appears as though the previous behavior (trimming whitespace) may
have been restored using a linked-on-or-after test. My delegate gets
trimmed strings if I link against the 10.4 SDK, untrimmed strings if
I link against the 10.5 SDK.
Maybe someone from Apple can confirm this.
This behavior preserves binary compatibility with apps written for
10.4 which expected to get the trimmed strings since that is all
they were ever sent.
If you support 10.4 you must plan on getting trimmed strings,
because that was always the behavior.
If possible, link against the 10.5 SDK, since that seems to get you
the behavior you desire on Leopard.
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