Re: NSArray to string and back problems
Re: NSArray to string and back problems
- Subject: Re: NSArray to string and back problems
- From: Colin Cornaby <email@hidden>
- Date: Wed, 23 Nov 2005 23:24:28 -0800
Right. I've also tried:
[NSPropertyListSerialization dataFromPropertyList:filtersToArchive
format:NSPropertyListXMLFormat_v1_0 errorDescription:nil]
And that didn't work either, it simply return nil. (filtersToArchive
is an array). I haven't gone through and debugged it yet with the
errorDescription.
One of the requirements is the array has to be derived to a string,
as a plist is.
On Nov 23, 2005, at 10:28 PM, Shawn Erickson wrote:
On Nov 23, 2005, at 10:03 PM, Colin Cornaby wrote:
I'm trying to convert an NSArray to a string and read it back at a
later point. I call [myMutableArray description], store it away,
and then later try to recreate the array using [arrayString
propertyList].
However, upon trying to return an NSArray from the string I get:
2005-11-23 21:37:08.801 Catalyst[17518] XML parser error:
Unexpected character ( at line 1
Old-style plist parser error:
Expected terminating ')' for array at line 5
Here is the description string:
2005-11-23 21:38:37.992 Catalyst[17542] (
{
CIFilterName = CIHueAdjust;
inputAngle = 1.475182809936707;
inputImage = {CIImage [0 0 22 26]};
}
)
Is this a bug? I searched CocoaBuilder and found a message
detailing the exact same problem in 2001, but no one ever replied
to it.
Description is not meant as a way to serialize (aka archive) an array.
Review NSCoding which NSArray implements...
<http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/ObjC_classic/Protocols/NSCoding.html>
Then review...
<http://developer.apple.com/documentation/Cocoa/Conceptual/
Archiving/index.html#//apple_ref/doc/uid/10000047i>
Also consider...
<http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/ObjC_classic/Classes/NSPropertyListSerialztion_index.html>
-Shawn
_______________________________________________
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