• 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: NSDictionary and XML-format property lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary and XML-format property lists


  • Subject: Re: NSDictionary and XML-format property lists
  • From: Luke Adamson <email@hidden>
  • Date: Tue, 19 Jun 2001 08:29:40 -0700

On Tuesday, June 19, 2001, at 04:06 AM, Bill Cheeseman wrote:

Why doesn't NSDictionary have a 'description...' method named something like
'descriptionInXMLFormat'?

You probably want something along these lines:

@implementation NSDictionary (YourExtensions)

- (NSData *)xmlDataRepresentation;
{
return (NSData *)CFPropertyListCreateXMLData(NULL, self);
}

- (NSString *)xmlDescription;
{
// I actually have no idea what CFPropertyListCreateXMLData trickles down to in terms of string encoding. UTF-8 is a guess.
return [NSString stringWithData:[self xmlDataRepresentation] encoding:NSUTF8StringEncoding];
}

@end

---
Luke


References: 
 >NSDictionary and XML-format property lists (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: NSOutlineView in Java
  • Next by Date: Re: Further NSWindow and NSWindowController problems
  • Previous by thread: NSDictionary and XML-format property lists
  • Next by thread: Re: NSDictionary and XML-format property lists
  • Index(es):
    • Date
    • Thread