Re: [SOLVED] Code to convert NSDictionary to binary plist file?
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