• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreData can't handle booleans in metadata
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: CoreData can't handle booleans in metadata
      • From: Jim Correia <email@hidden>
  • Prev by Date: Is SearchKit's binary index Universal?
  • Next by Date: Resolution independent cursors
  • Previous by thread: Re: Is SearchKit's binary index Universal?
  • Next by thread: Re: CoreData can't handle booleans in metadata
  • Index(es):
    • Date
    • Thread