Using NSPropertyListSerialization with NSArray of NSDictionaries
Using NSPropertyListSerialization with NSArray of NSDictionaries
- Subject: Using NSPropertyListSerialization with NSArray of NSDictionaries
- From: Rick Hoge <email@hidden>
- Date: Mon, 2 May 2005 16:25:09 -0400
It would be very useful for us to store an ordered array of
dictionaries using NSPropertyListSerialization. The code below works
fine if processingInfo is an NSDictionary, but fails with the message
"Property list invalid for format" if processingInfo is an array of
dictionaries.
Is there any other reasonable way to do this? The docs say that as
long is everything is an array, dictionary, number, string, or date
it should work. Should I file a bug?
Thanks for any hints,
Rick
if (processingInfo) {
xmlData = [NSPropertyListSerialization dataFromPropertyList:
[processingInfo objectAtIndex:0]
format:NSPropertyListXMLFormat_v1_0
errorDescription:&error];
if (xmlData) {
char *str = malloc([xmlData length]+1); // Add trailing '\0'
memcpy(str,[xmlData bytes],[xmlData length]);
str[[xmlData length]] = '\0';
miattputstr(mincid, varid, "processingInfo", str);
free(str);
} else {
NSLog(error);
[error release];
}
}
_______________________________________________
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