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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to