On Apr 28, 2009, at 1:39 PM, Alexander Spohr wrote:

Am 28.04.2009 um 21:22 schrieb Keary Suska:

NSMutableDictionary *theDicRow = [NSMutableDictionary dictionaryWithObjectsAndKeys:
        @"Text A", @"colA",
        @"", @"colB",
        nil ];
I am not surprised to see this behavior, for various reasons. The short answer is no, you can't have an empty string for a key in conjunction with an NSArrayController. What would be the key path for an empty string?

As a note: the code sets the value to the empty string. The key is colB.


It pays to pay attention. Sorry for that.

Anyway, I am still not entirely surprised, as the GUI doesn't distinguish between empty and nil values. At least as far as an NSTextField/Cell is concerned. I would be curious whether there is a binding to the value, and if unbound, the behavior remains.

I have had to deal with this situation particularly as it related to RDBMS's, which *do* distinguish between NULL and and empty, and it's an important distinction. In cases where you know you will need to handle an empty value and you want to make sure it will *never* be nil, you can use a transformer.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to