Re: NSKeyedArchiver XML output?
Re: NSKeyedArchiver XML output?
- Subject: Re: NSKeyedArchiver XML output?
- From: Graham Cox <email@hidden>
- Date: Mon, 8 Dec 2008 21:09:23 +1100
On 8 Dec 2008, at 8:44 pm, Devraj Mukherjee wrote:
Hi all,
I am trying to get an sample project that demos NSKeyedArchiver to
write in the XML format,
All I can see is a call to a message
[NSKeyedArchiver archiveRootObject: rootObject toFile: path];
how do I instruct NSKeyedArchiver to write in its XML format?
Like so:
NSMutableData* data = [[NSMutableData alloc] init];
NSKeyedArchiver* karch = [[NSKeyedArchiver alloc]
initForWritingWithMutableData:data];
[karch setOutputFormat:NSPropertyListXMLFormat_v1_0];
[karch encodeObject:myArchivableRootObject forKey:@"root"];
[karch finishEncoding];
[karch release];
return [data autorelease];
hth,
Graham
_______________________________________________
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