• 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
Re: How to store NSRect as Core Data attribute?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to store NSRect as Core Data attribute?
      • From: "stephen joseph butler" <email@hidden>
    • Re: How to store NSRect as Core Data attribute?
      • From: Adam P Jenkins <email@hidden>
References: 
 >How to store NSRect as Core Data attribute? (From: Daniel Thorpe <email@hidden>)
 >Re: How to store NSRect as Core Data attribute? (From: Ben Lachman <email@hidden>)
 >Re: How to store NSRect as Core Data attribute? (From: Thomas Engelmeier <email@hidden>)
 >Re: How to store NSRect as Core Data attribute? (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: Read jpeg comments from file?
  • Next by Date: KVC - how to get properties into a common form?
  • Previous by thread: Re: How to store NSRect as Core Data attribute?
  • Next by thread: Re: How to store NSRect as Core Data attribute?
  • Index(es):
    • Date
    • Thread