Re: How to store NSRect as Core Data attribute?
Re: How to store NSRect as Core Data attribute?
- Subject: Re: How to store NSRect as Core Data attribute?
- From: Daniel Thorpe <email@hidden>
- Date: Thu, 3 Apr 2008 10:31:42 +0100
Thanks for the feedback on this.
I have gone with using a ...AsString attribute and using
NSRectFromString. Seems to work okay, although I've got no idea if
it's the most efficient method. I think Core Data seems a little
limited in that you can't store an NSValue object as an attribute, I'd
have thought that would be obvious, as we use that class to store
structs in collection objects....
I hadn't considered localisation issues, but on my machine it stores
the data like so in an XML store:
<attribute name="extentasstring" type="string">{{368, 260},
{2, 5}}</attribute>
<attribute name="centreofmassasstring" type="string">{368.75,
263.25}</attribute>
which seems to make sense.
Cheers
Dan
On 2 Apr 2008, at 18:33, Uli Kusterer wrote:
On 02.04.2008, at 18:58, Thomas Engelmeier wrote:
That potentially means opening Pandoras can to localisation issues.
Any time you go that route, be sure to check that code with
switching decimal separators.
Potentially? Maybe. But I just tried it, and for me
NSStringFromRect() never uses localized separators. So, since it
always gives and takes periods as the decimal separator, I see no
problem. Do you have a particular test case where it behaves
differently?
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
_______________________________________________
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