• 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
Re: NSData to plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSData to plist


  • Subject: Re: NSData to plist
  • From: Jérôme Laurens <email@hidden>
  • Date: Fri, 6 Dec 2002 09:03:48 +0100

Le vendredi, 6 dic 2002, ` 04:57 Europe/Zurich, crucial felix a icrit :

Hey y'all,

I'm trying to open my iTunes xml library. easily viewable in PropertyList editor, the root object is a Dictionary.

I swiftly got it as an NSData, but now i'm trying to figure out how to get it out of that.

i try using this: NSPropertyListSerialization method:
+ (id)propertyListFromData:(NSData *)data mutabilityOption:(NSPropertyListMutabilityOptions)opt format:(NSPropertyListFormat *)format errorDescription:(NSString **)errorString


NSData *data = [NSData dataWithContentsOfFile:[@"~/Music/iTunes/iTunes Music Library.xml" stringByStandardizingPath]];

NSDictionary *plist = [NSPropertyListSerialization
propertyListFromData:data mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:NSPropertyListXMLFormat_v1_0
errorDescription:@"blah"];


he he he, you mismatched the types


here is the right code

NSString * errorString;
int format;

[NSPropertyListSerialization
propertyListFromData:data mutabilityOption:NSPropertyListMutableContainersAndLeaves
format: &format
errorDescription:&errorString];


if(errorString)
{
NSLog(errorString);
[errorString autorelease];
}

I am laughing now, but I got trapped myself...
BTW this problem already appeared in the list
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSData to plist
      • From: crucial felix <email@hidden>
References: 
 >NSData to plist (From: crucial felix <email@hidden>)

  • Prev by Date: runtime error with NSArray no more!
  • Next by Date: drawRect & needsDisplay & co
  • Previous by thread: Re: NSData to plist
  • Next by thread: Re: NSData to plist
  • Index(es):
    • Date
    • Thread