• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using NSPropertyListSerialization with NSArray of NSDictionaries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Using NSPropertyListSerialization with NSArray of NSDictionaries
      • From: Rick Hoge <email@hidden>
  • Prev by Date: [Moderator] Re: Tiger documentation update
  • Next by Date: Re: When is (NSColor) black not black?
  • Previous by thread: Re: use class objet instead of an instance object
  • Next by thread: Re: Using NSPropertyListSerialization with NSArray of NSDictionaries
  • Index(es):
    • Date
    • Thread