Re: Returning structs of NSStrings
Re: Returning structs of NSStrings
- Subject: Re: Returning structs of NSStrings
- From: Michael Becker <email@hidden>
- Date: Thu, 25 Mar 2004 10:55:42 +0100
Am 25.03.2004 um 10:22 schrieb Michael Becker:
NSDatat *xmlData = [ network getUserXMLData]:
[ . . . ]
MyUser user;
user.name = [[ xmlContainer descriptionAtIndex:0] autorelease];
user.phone = [[ xmlContainer desciprtionAtIndex:0] autorelease];
user.street = [[ xmlContainer descriptionAtIndex:0] autorelease];
return user;
To my very surprise, this yields the following (for every
"autoreleased" NSString):
*** malloc[2720]: error for object 0x398ed0: Double free
Removing the autorelease rids me of this error. Am I forgetting that
the NSStrings returned by the xmlContainer object are most likely
already autoreleased and thus I don't have to care?
I just don't want to leak memory, and much more important, don't want
my app to crash with SIGBUS/SIGSERV etc.
Bye,
Michael
_______________________________________________
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.