CoreData can't handle booleans in metadata
CoreData can't handle booleans in metadata
- Subject: CoreData can't handle booleans in metadata
- From: "Jim Thomason" <email@hidden>
- Date: Mon, 6 Aug 2007 08:48:48 -0500
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 -
An uncaught exception was raised
2007-08-06 08:45:57.066 CDtest[14886] XML parser error:
Encountered non-empty <false> tag on line 5
Old-style plist parser error:
Malformed data byte group at line 2; invalid hex
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.
Is there any reason for this seemgingly horribly buggy behavior? Some
flag I need to set or something? I'd much rather use booleans over
integers (they're boolean values - it's more clear to set the bool in
code than an int), and I definitely want to be sure that no other
booleans could come in and goof up my store if I'm not paying
attention.
-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