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 Thomason" <email@hidden>
- Date: Mon, 6 Aug 2007 12:00:21 -0500
> 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.
Good. I'm glad to know I'm not crazy. At least not in this case.
> For the cases where you put the values in, you can make sure you
> don't write booleans.
My concern was storing an NSNumber that I didn't create into the
metadata. Say it was preference that came from a checkbox or out of a
framework I was linking in. If it was an NSNumber created with
numberWithBool:, it'd write out <true></true> and trigger the bug.
So I went and wrapped up all of those places with:
[NSNumber numberWithInt:[someNSNumberObject intValue]]
to ensure that it's always an integer NSNumber.
Clunky, but it prevents the problem. Unless I missed one, of course. ;-)
-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