Re: How to store NSRect as Core Data attribute?

2008-04-09 Thread Adam P Jenkins
Hmm, seems I was misunderstanding what the built-in value transformers do, and also had a problem with my custom transformer. The NSUnarchiveFromData transformer won't work for this purpose. However you can make it possible to store NSValue objects as Core Data attributes by using a

Re: How to store NSRect as Core Data attribute?

2008-04-08 Thread Adam P Jenkins
Actually on Leopard you should be able to store an NSValue as an attribute, simply by using an attribute of type Transformable, and setting the Value Transformer Name to NSUnarchiveFromData. I just tried it though, and it seems like there is a bug which prevents it from working. Basically

Re: How to store NSRect as Core Data attribute?

2008-04-08 Thread stephen joseph butler
On Thu, Apr 3, 2008 at 4:31 AM, Daniel Thorpe [EMAIL PROTECTED] wrote: 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

Re: How to store NSRect as Core Data attribute?

2008-04-03 Thread Daniel Thorpe
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,

How to store NSRect as Core Data attribute?

2008-04-02 Thread Daniel Thorpe
Hello everyone, I'm trying to get to grips with non-standard persistent attributes in Core Data. I've read through the docs I can find (http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html ) but I'm still having some issues storing an NSRect in an

Re: How to store NSRect as Core Data attribute?

2008-04-02 Thread Felix Franz
On 02.04.2008, at 13:28, Daniel Thorpe wrote: Hello everyone, I'm trying to get to grips with non-standard persistent attributes in Core Data. I've read through the docs I can find (http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html ) but I'm

Re: How to store NSRect as Core Data attribute?

2008-04-02 Thread Thomas Engelmeier
On 02.04.2008, at 18:12, Ben Lachman wrote: I think the easiest way to encode/decode NSRects for storage is NSStringFromRect() and NSRectFromString(). Then you can just implement a custom accessor for the property that converts in the direction you need. That potentially means opening

Re: How to store NSRect as Core Data attribute?

2008-04-02 Thread Uli Kusterer
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