Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSPropertyListSerialization with NSArray of NSDictionaries




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.