• 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: Hiding NSKeyValueCoding$Null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding NSKeyValueCoding$Null


  • Subject: Re: Hiding NSKeyValueCoding$Null
  • From: John Boynton <email@hidden>
  • Date: Tue, 09 Sep 2003 11:18:11 -0600

Hi Merul and list,

If there is a cleaner solution I'd like to hear about it, but I turn the raw rows into a subclass of NSDictionary that translates returned NSKeyValueCoding.Null values into null values:

NullTranslatingDict myDict = new NullTranslatingDict(rawRow);
Object possiblyNull = myDict.valueForKey("keyOfPossiblyNullObject");

NullTranslatingDict has, among other things:

   private _realDict;

   public NullTranslatingDict(NSDictionary realDict) {
       _realDict = realDict;
   }

   public Object valueForKey(String key) {
      Object result = _realDict.valueForKey(key);

      if (NSKeyValueCoding.NullValue == result) {
         result = null;
      }
      return result;
   }

- John

Merul Patel wrote:

Hi,

I'm fetching a large data set using a raw row fetch since I don't need to initially instantiate any EOs for the returned objects.

When I bind any key from a dictionary in the returned array to a WOString, I'm getting an unsightly value for those fields that contain null values: <com.webobjects.foundation.NSKeyValueCoding$Null>

If I change the fetch to return EOs then null fields are correctly displayed, so is there a simple way to do the same for WOStrings bound to NSDictionary keys?

Thanks,

Merul
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Hiding NSKeyValueCoding$Null
      • From: Arturo PĂ©rez <email@hidden>
References: 
 >Hiding NSKeyValueCoding$Null (From: Merul Patel <email@hidden>)

  • Prev by Date: Re: display pdf,rtf,word,postscript files in browser
  • Next by Date: Re: display pdf,rtf,word,postscript files in browser
  • Previous by thread: Re: Hiding NSKeyValueCoding$Null
  • Next by thread: Re: Hiding NSKeyValueCoding$Null
  • Index(es):
    • Date
    • Thread