Re: CoreData models as structures
Re: CoreData models as structures
- Subject: Re: CoreData models as structures
- From: Quincey Morris <email@hidden>
- Date: Sat, 6 Nov 2010 10:25:53 -0700
On Nov 6, 2010, at 06:54, Ayers, Joseph wrote:
> On Nov 5, 2010, at 7:52 PM, Quincey Morris wrote:
>
>> A. With your declarations, 'tapeList.tapes' is a NSSet. The set doesn't have a "VideoClio" property (though its members do), and the compiler is correctly telling you that you can't refer to such a property. *Which* 'tapes' object are you trying to refer to?
>
> That is indeed the problem. VideoClip is a relationship of tapes. How should this be addressed?
Well, it depends what you're trying to do. You mentioned a reference to 'tapeList.tapes.VideoClip'. What's the context of that reference, and what object or objects are you trying to use there?
>>
>> B. This is not how you use properties in Core Data -- you do NOT declare instance variables corresponding to the properties in your data model. Instead, those properties are defined for you by Core Data. You *do* have to supply property declarations to keep the compiler happy (as described in the Core Data documentation).
>>
>
> The manual says that you have to declare the properties to maintain 32bit compatability.
There's nothing in the documentation that says you need to declare *instance variables*. Using NSManagedObject subclasses is described here:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdManagedObjects.html#//apple_ref/doc/uid/TP40003397-258615
There are no instance variables in this pattern. (Note that there are custom property scenarios where extra instance variables are needed, but that's not the scenario you have.)
_______________________________________________
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