• 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: XML to Plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML to Plist


  • Subject: Re: XML to Plist
  • From: Peter Lübke <email@hidden>
  • Date: Tue, 28 Dec 2010 23:25:06 +0100

Hi Sandro,

just to mention it (this has nothing to do with your original question):
Why don't you create your NSMutableDictionary with [NSMutableDictionary dictionary] ?
This produces exactly the same result as [[[NSMutableDictionary alloc] init] autorelease] -
practically all Cocoa CLASS methods that create objects return newly allocated, inited and autoreleased objects unless otherwise stated in the docs.


Best regards,
Peter

Am 28.12.2010 um 19:34 schrieb Sandro Noël:

- (NSDictionary *) plist{
NSMutableDictionary *resultDict = [[[NSMutableDictionary alloc] init] autorelease];
if ([self hasChildren]){
NSMutableDictionary *child = [[[NSMutableDictionary alloc]init] autorelease];
for (OSXMLElement *element in _children){
[child addEntriesFromDictionary:[element plist]]; }
[resultDict setValue:child forKey:_elementName];
}
else {
[resultDict setValue:_elementText forKey:_elementName];
}
return resultDict;
}

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: XML to Plist (From: Greg Guerin <email@hidden>)
 >Re: XML to Plist (From: Sandro Noël <email@hidden>)

  • Prev by Date: Multiple File Open Strategy
  • Next by Date: Ensuring no selection in a table view
  • Previous by thread: Re: XML to Plist
  • Next by thread: Re: XML to Plist
  • Index(es):
    • Date
    • Thread