Re: CoreData can't handle booleans in metadata
Re: CoreData can't handle booleans in metadata
- Subject: Re: CoreData can't handle booleans in metadata
- From: Jim Correia <email@hidden>
- Date: Mon, 6 Aug 2007 11:28:01 -0400
On Aug 6, 2007, at 9:48 AM, Jim Thomason wrote:
I've found a couple of references to this problem in the list
archives, but no solutions, so I'll ask again and file a bug report.
CoreData doesn't seem to properly write out boolean values in the
metadata dictionary to XML stores
[metadataDictionary setObject:[NSNumber numberWithBool:YES]
forKey:@"some boolean"];
It will accept it, and will write it out, but it will give it a value
of "<true></true>", instead of "<true/>". This causes an XML parser
error when trying to read the file -
Stylistically, <true/> is preferred to <true></true>, but both should
be equivalent and valid. That the latter is not handled correctly is
a bug in the plist parser.
I've previously filed bugs about both issues.
I can hack around it by never using boolean values and always using
integers, but that seems clunky. Besides, I'm somewhat concerned that
a boolean based value may somehow get into my metadata if I'm not
paying close attention, and that would apparently gum up the whole
works.
The only way for values to get into the metadata area is
1) CoreData puts them there
2) you put them there
3) someone else put them there
I don't believe CoreData ever writes boolean values to the metadata
area on 10.4.x.
For the cases where you put the values in, you can make sure you
don't write booleans.
If someone else is modifying your documents/stores, tell them to cut
it out. :-)
Jim
_______________________________________________
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