On Feb 22, 2011, at 15:04, Ayers, Joseph wrote:

> I understood from Scott Stevensons book that in 32bit mode you had to declare 
> the instance variables.

Nope, not for Core Data (not unless you need instance variables *of your own* 
to implement custom properties or for some other reason). Core Data doesn't use 
instance variables internally at all (for your properties, I mean). See:

        
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html%23//apple_ref/doc/uid/TP40002154-SW9

IMO, this documentation is slightly confusing. You can *EITHER* declare the 
properties for Core Data-supplied scalar accessor methods (TapeName, TapeDate, 
Notes, VideoClip) in a class extension -- Tapes () -- and use @dynamic for each 
one in your implementation *OR* declare them in a non-existent category -- 
Tapes (TapesAccessors), if you follow the documentation's pattern -- and avoid 
the need for @dynamic.

The documentation doesn't make it clear that there are 2 ways of doing it.

In the case of the add/remove accessors, you can't use @dynamic to tell the 
compiler about the Core Data-supplied methods, so you have to use the 
non-existent category technique.

With your current class definition, the instance variables will be ignored 
completely. They will be nil unless you put something in them manually, and if 
you do that they have no effect on the Core Data properties.


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to