• 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: NSArrayController: Objects with empty strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController: Objects with empty strings


  • Subject: Re: NSArrayController: Objects with empty strings
  • From: Keary Suska <email@hidden>
  • Date: Tue, 28 Apr 2009 14:07:25 -0600

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 (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


References: 
 >NSArrayController: Objects with empty strings (From: MyApps <email@hidden>)
 >Re: NSArrayController: Objects with empty strings (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: passing complex objects between threads
  • Next by Date: Re: Cocoa-dev Digest, Vol 6, Issue 641
  • Previous by thread: Re: NSArrayController: Objects with empty strings
  • Next by thread: Re: NSArrayController: Objects with empty strings
  • Index(es):
    • Date
    • Thread