• 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 descriptionWithLocale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary descriptionWithLocale


  • Subject: Re: NSDictionary descriptionWithLocale
  • From: Ivan C Myrvold <email@hidden>
  • Date: Wed, 14 Mar 2007 14:48:02 +0100

I have looked at NSPropertyListSerialization before I sent the message to the list, and reread it now again to see if I have missed anything. But I am unable to see how this class can help me. This class is serializing and dserializing to/from NSData. That is not what I want, I want an NSString containing a string representation of an xml propertylist.

The only way I have found to work is:

NSDictionary *mydictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"firstobject", @"firstkey", @"secondobject", @"secondkey", nil];
BOOL success = [mydictionary writeToFile:path atomically:YES];
NSString *pliststr = [NSString stringWithContentsOfFile:path];


This works, but is a bit clumsy, to have to write to a file and read from file to get what I want.

Ivan


On 14. mar. 2007, at 14.12, Andreas Mayer wrote:


Am 14.03.2007 um 12:25 Uhr schrieb Ivan C Myrvold:

I want to have a xml propertylist representation of an NSDictionary stored in NSString.

Typing the quoted sentence into Google yields the Property List Programming Guide for Cocoa as the first hit. That document answers your question.


(Hint: NSPropertyListSerialization)


Andreas _______________________________________________

Cocoa-dev mailing list (email@hidden)

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


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSDictionary descriptionWithLocale
      • From: Andreas Mayer <email@hidden>
    • Re: NSDictionary descriptionWithLocale
      • From: Andy Lee <email@hidden>
References: 
 >NSDictionary descriptionWithLocale (From: Ivan C Myrvold <email@hidden>)
 >Re: NSDictionary descriptionWithLocale (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Locating a Framework in a Non-Standard Directory
  • Next by Date: NSArrayController, saving and reloading sort descriptors
  • Previous by thread: Re: NSDictionary descriptionWithLocale
  • Next by thread: Re: NSDictionary descriptionWithLocale
  • Index(es):
    • Date
    • Thread