Re: Make Custom Struct Key-Value Coding Compliant

2012-02-15 Thread Richard Somers
SOLVED - Thanks for all the comments. On Feb 11, 2012, at 11:56 PM, Graham Cox wrote: Making it an object is easy and usually it turns out that the desire to resist doing that is misguided, based on some faulty assumptions. I decided to resist no longer and make my custom strut an object. I

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-12 Thread Kyle Sluder
On Sat, Feb 11, 2012 at 11:40 PM, Richard Somers rsomers...@awinets.com wrote: Karoly Lorentey has a blog entry Efficient Scalar Attributes in Core Data for iOS. I was trying to follow his lead except target Mac OS X v10.6 using a struct instead of a single scalar but it has been rough going.

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-12 Thread Richard Somers
On Feb 12, 2012, at 1:28 AM, Kyle Sluder wrote: Hmm. The Foundation Release Notes for 10.5 indicate that KVC supports arbitrary structs (see section titled Support for Arbitrary Types in KVC and KVO) Yes I have read that several times. It seems to be at odds with the Core Data

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-12 Thread Joar Wingfors
On 12 feb 2012, at 01:04, Richard Somers wrote: Hmm. The Foundation Release Notes for 10.5 indicate that KVC supports arbitrary structs (see section titled Support for Arbitrary Types in KVC and KVO) Yes I have read that several times. It seems to be at odds with the Core Data

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-12 Thread Ben Kennedy
On 12 Feb 2012, at 1:04 am, Richard Somers wrote: Another confusing thing is that Xcode 4.2 has a new undocumented checkbox called Use scalar properties in the class generation sheet. But this only works with iOS 5 and Mac OS X 10.7. I can testify (after some frustrating time tracking it

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-12 Thread Graham Cox
On 12/02/2012, at 6:40 PM, Richard Somers wrote: It just seems so heavy. My app will be using the scalar accessors very frequently. Seems. But is it? There's no reason I can think of that this couldn't be efficient, using caching as necessary and so on. If the ultimate goal is to render

Make Custom Struct Key-Value Coding Compliant

2012-02-11 Thread Richard Somers
Core Data Question I have a custom struct that I would like to make key-value coding compliant so it will work with Core Data as a non-standard persistent attribute. Is it possible to make a custom struct key-value coding compliant? I would rather not store it in the managed object as an

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-11 Thread Graham Cox
On 12/02/2012, at 5:43 PM, Richard Somers wrote: I would rather not store it in the managed object as an object but would like to leave it as a struct and have it work just like NSPoint, NSSize, NSRect, or NSRange. May one ask why? The section of the documentation you posted spells out

Re: Make Custom Struct Key-Value Coding Compliant

2012-02-11 Thread Kyle Sluder
On Feb 11, 2012, at 10:56 PM, Graham Cox graham@bigpond.com wrote: Making it an object is easy and usually it turns out that the desire to resist doing that is misguided, based on some faulty assumptions. What are yours? If you need a scalar struct to pass to external code, just declare