• 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: NSKeyedArchiver XML output?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSKeyedArchiver XML output? (From: "Devraj Mukherjee" <email@hidden>)

  • Prev by Date: Re: Unit Testing Frameworks
  • Next by Date: Re: NSKeyedArchiver XML output?
  • Previous by thread: NSKeyedArchiver XML output?
  • Next by thread: Re: NSKeyedArchiver XML output?
  • Index(es):
    • Date
    • Thread