Re: Parsing XML to CoreData
Re: Parsing XML to CoreData
- Subject: Re: Parsing XML to CoreData
- From: Siegfried <email@hidden>
- Date: Thu, 24 Mar 2011 13:24:53 -0300
On 24/03/2011, at 13:13, Hank Heijink (Mailinglists) wrote:
> On Mar 24, 2011, at 12:06 PM, Siegfried wrote:
>
>> So, after discussing some methods to import and export a CoreData database, I ended up sticking with my initial XML idea.
>> ...
>
> You need to copy currentXMLValue, because in your code, every item that refers to it ends up referring to the same mutable string, which will change every time the parser:foundCharacters: method is called.
>
> NSString *newValue = [currentXMLValue copy];
> [currentEntity setValue:newValue forKey:kAttrName];
> [newValue release];
>
> Assigning strings like you did works with immutable ones, but not with mutable ones.
Ah Hank! How can I thank you?
Such a simple thing but was driving me crackers.
Thanks so much,
Best regards,
Siegfried_______________________________________________
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