Am Mi,27.08.2008 um 18:22 schrieb Oleg Krupnov:

A simple newbie question:

Suppose I have a Core Data model object MyObject with property myProp
defined in the model editor's schema.

Can I use the simple accessors like this:

[myObj myProp]
[myObj setMyProp]

or am I forced to use the rather clunky valueForKey/setVakyeForKey messages?
Managed objects automatically fake accessors for entities.

You can subclass NSManagedObject and add properties using @property and @dynamic, which means, that the accessors will be generated dynamically at run-time. (Without @dynamic you will get a compiler warning: incomplete implementation blablabla)

There is documentation about @property and Core-Data esp. in relation to retain/copy/assign. (The quintessence: Use retain!)

Cheers,
Amin



I thought that Core Data kind of auto-generates these standard
accessors for me and I don't have to write any manual code (if I don't
want anything special). However I've just got the compiler warning
that "MyObhect may not respond to '-myProp'"

Was I wrong or am I doing something wrong?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/negm-awad%40cocoading.de

This email sent to [EMAIL PROTECTED]

Amin Negm-Awad
[EMAIL PROTECTED]





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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