Re: NSDictionary descriptionWithLocale
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