• 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
Property lists: CFPropertyList docs vs. Foundation docs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Property lists: CFPropertyList docs vs. Foundation docs


  • Subject: Property lists: CFPropertyList docs vs. Foundation docs
  • From: Mason Mark <email@hidden>
  • Date: Wed, 17 Apr 2002 03:04:36 -0700

Hello,

I wonder if anybody can clarify what I think might be a discrepancy in the documentation regarding property lists.

According to the class docs for NSDictionary, to safely use the API to read and write dictionaries to and from disk, "the dictionary must contain only property list objects (NSString, NSData, NSArray, or NSDictionary objects)."

The documentation for CFDictionary states: "Property lists organize data into named values and lists of values using several Core Foundation types:
CFString, CFNumber, CFBoolean, CFDate, CFData, CFArray, and CFDictionary.
"

At first glance, CFDictionary seems to support three more "property list" types than NSDictionary.

However, release notes state that CFDictionary and NSDictionary are toll-free bridged.

This makes me think that the Foundation docs might simply be a little out of date, and it might actually be safe to use an NSDictionary to store, say, NSDate objects (which are toll-free bridged to CFDate), and still expect the dictionary to be able to read itself from and write itself to disk.

Can anybody definitively clarify? The reason I want to know is that I wrote a bunch of code a while back where I assumed (incorrectly it seems) that NSDate and NSNumber were supported property list types for using with NSDictionary. I think I misremembered this detail, and was thinking of the documentation for CFDictionary.

Anyway, I want to bring that code into a current project, so I started updating it. But it does seem to work fine--that is, the dictionaries seem to read/write to/from disk without problems even when they contain NSNumber and NSDate objects.

However, this is contrary to the NSDictionary documentation, so I was planning to update the code anyway, just to be safe (and encode/decode the NSNumber and NSDate objects myself). However, I don't want to bother with doing this if I don't need to, so I want to be certain.

If anybody who really knows could clarify, I'd appreciate it.

Thanks,
--
Mason Mark
Five Speed Software, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Property lists: CFPropertyList docs vs. Foundation docs
      • From: Rosyna <email@hidden>
  • Prev by Date: Using Carbon in Cocoa App
  • Next by Date: Re: Using Carbon in Cocoa App
  • Previous by thread: Re: Using Carbon in Cocoa App
  • Next by thread: Re: Property lists: CFPropertyList docs vs. Foundation docs
  • Index(es):
    • Date
    • Thread