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 (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]