• 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: [SOLVED] Code to convert NSDictionary to binary plist file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] Code to convert NSDictionary to binary plist file?


  • Subject: Re: [SOLVED] Code to convert NSDictionary to binary plist file?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 4 Jun 2008 09:55:30 +0200



Le 4 juin 08 à 04:13, Ken Thomases a écrit :

On Jun 3, 2008, at 8:49 PM, David Hoerl wrote:

ret = [manager createFileAtPath:@"/tmp/binary.plist" contents:plist attributes:nil];

You can also do [plist writeToFile:...] to write the data object out. There's nothing wrong with what you wrote, but since you were already familiar with the writeToFile:... methods, I thought it might be conceptually simpler.


Cheers,
Ken

Just to add a point.

All type accepted inproperty list are tool free bridged with CoreFundation equivalent, so you can also use CFPropertyList functions like CFPropertyListWriteToStream();
It allow you to write directly you dictionary without having to store the whole NSData representation into memory (may be usefull if you have a lots of data).


And note too that CFWriteStreamRef is interchangeable with NSOutputStream, so you can do this using only Obj-C classes ;-)

_______________________________________________

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: 
 >[SOLVED] Code to convert NSDictionary to binary plist file? (From: David Hoerl <email@hidden>)
 >Re: [SOLVED] Code to convert NSDictionary to binary plist file? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Apple Remote and exclusivity
  • Next by Date: Re: What's the NSMailDelivery replacement for Leopard and Beyond?
  • Previous by thread: Re: [SOLVED] Code to convert NSDictionary to binary plist file?
  • Next by thread: What's the NSMailDelivery replacement for Leopard and Beyond?
  • Index(es):
    • Date
    • Thread