Re: Swift Enums and CoreData
Re: Swift Enums and CoreData
- Subject: Re: Swift Enums and CoreData
- From: Quincey Morris <email@hidden>
- Date: Mon, 06 Jul 2015 23:29:39 +0000
On Jul 6, 2015, at 16:21 , Rick Aurbach <email@hidden> wrote:
>
> Are you suggesting that we implement a custom fetched property
No, I’m thinking of this:
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html#//apple_ref/doc/uid/TP40001919-SW13 <https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html#//apple_ref/doc/uid/TP40001919-SW13>
under the heading “Scalar Value”, but some of the details are here:
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW1 <https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW1>
The idea is that you create non-primitive accessors that have a type that’s not known to Core Data. You back it with a Core Data property, using any convenient mechanism. Optionally, you can have an instance variable that caches the non-CD value, or you can just convert it back and forth on the fly.
Note that you can, of course, back your customized property with multiple CD properties, or with a CD property whose value themselves have sub-properties.
_______________________________________________
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