Re: NSString propertyList crash
Re: NSString propertyList crash
- Subject: Re: NSString propertyList crash
- From: Andy Lee <email@hidden>
- Date: Mon, 20 Mar 2006 00:30:50 -0500
On Mar 19, 2006, at 11:39 PM, Tito Ciuro wrote:
Hi Andy,
That works fine. :-)
Greg Herlihy's approach, using +dataWithContentsOfFile:, might be
safer, given what he said about binary plist files.
Just for completeness, adding the following statement will convert
the NSString to a dictionary:
NSDictionary *newDict = [dictXML propertyList];
NSLog(@"newDict: %@", newDict);
Interesting -- the doc for -propertyList doesn't say anything about
being able to parse XML. In fact, it describes a syntax that is
definitely *not* XML. I guess it's smart enough to tell which format
it's looking at. I sent feedback about this using the link at the
bottom of the NSString page.
On Mar 19, 2006, at 11:40 PM, Tito Ciuro wrote:
On 19/03/2006, at 20:31, Andy Lee wrote:
NSDictionary *dict =
[NSDictionary dictionaryWithObjectsAndKeys:
[NSDate date], @"today",
nil];
NSString *desc = [dict description];
NSDictionary *newDict = [desc propertyList]; // throws exception
It sure looks like a bug to me...
I looked closer at the docs and they don't explicitly say the two
methods are supposed to be mirror images, but it's implied strongly
enough that I think it's clearly a bug. The exception also gets
raised if you use the StringsFileFormat methods.
I was about to report this, but bugreport.apple.com is not letting me
log in right now.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden