I hacked the mogenerator header template file to emit property declarations for Core Data-generated accessors, and changed the source template files to not emit any code for accessors. So I get the convenience of mogenerator together with the supposedly more efficient Core Data accessors.

I found the template files quite easy to read and to change to my own specification.

i.

On Oct 5, 2008, at 00:11, Jerry Krinock wrote:

When developing NSManagedObjects for Mac OS 10.4, after about 25 trips to Xcode's menu Design > Data Model > Copy Method XXXX-tions to Clipboard, my wrist got sore and I started using mogenerator [1].

Now, developing for Mac OS X 10.5+, I read that "On Mac OS X v10.5, Core Data dynamically generates efficient public and primitive get and set attribute accessor methods and relationship accessor methods for managed object classes."

So, I don't ^need^ mogenerator, although I still may want to use it in order to get type checking and generate code needed to avoid compiler warnings. And although the "dynamically" generated methods are "efficient", I assumed that they are still not as efficient as a hard-coded method. But then, further down, in two highlighted "dire warning" boxes, I read ...

"Important: You are strongly encouraged to use dynamic properties (that is, properties whose implementation you specify as @dynamic) instead of creating custom implementations for standard or primitive accessor methods."

But I don't see any reasons given. Paradoxically these boxes seemed to be followed by instructions detailing how to do what was just recommended against doing [3], including code examples of standard accessors which look like what I get out of mogenerator.

My questions: Am I being "strongly encouraged" to ^not^ use mogenerator in a 10.5+ app? Why?

Thanks,

Jerry Krinock

[1] http://rentzsch.com/code/mogenerator_v1.5 (Be sure to use the installer, don't just build the tool.)

[2] In "Core Data Programming Guide" > "Managed Object Accessor Methods" http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#/ /apple_ref/doc/uid/TP40002154

[3] This "Well, if you insist on hanging yourself.." idiom is familiar to me in reading Apple documentation.

_______________________________________________

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/in.cocoadev %40iriz.net

This email sent to [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