On Tue, Apr 8, 2008 at 3:34 PM, Michael Burns <[EMAIL PROTECTED]> wrote:
> Interestingly enough, I started looking back to figure out where I had read
> that and realized it had come up in a thread I started back in September
> (http://www.cocoabuilder.com/archive/message/cocoa/2007/9/21/189533).  The
> only way I have found to accomplish what I need to is by putting the code in
> my CellMapWindowController -- linking the "New Cell" button to my own custom
> insert cell code which handles all the object creation/fetching I mentioned
> in my previous post.

  I hadn't seen that thread but I disagree with the assertion that
-awakeFromInsert is a bad place to fetch just because "it happens from
within one of the disallowed methods". Sure, certain situations can
cause problems, but not all. I have a complex application that fetches
from within an insert simply to examine the best place to insert
itself in "the list" of these instances by a computed rank (it is done
here so the ranking is persistent, which allows fetching only a few at
a time at some 'window' in the middle of the list while maintaining
the rank of tens of thousands of items). It has several subclasses
(most of which override -awakeFromInsert, call super, and continue
doing their own things). It's well-tested and works beautifully. It
even creates a few dependent instances of another entity like you're
doing.

  It all boils down to this (the last post in the thread you mentioned):

http://www.cocoabuilder.com/archive/message/cocoa/2007/9/21/189536

> I've been going back and forth trying to clean up my code as I'm learning
> more and more, but I don't know if I can clean this particular situation up
> at all.

  Sure you can. Take my advice and try it. If it doesn't work as
expected, post your code and a description of the misbehavior.

--
I.S.
_______________________________________________

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