On 4/8/08 3:53 PM, I. Savant said: >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 to disagree with your disagreement. :) I am finding calling executeFetchRequest during awakeFromInsert quite problematic. I'd be interested to know more about how you do it successfully. What are the "certain situations"? In my case, creating a new Foo requires finding existing Bars and setting up relationships between them. It seemed to me that doing this in the model layer was better than doing it in the controller layer, so in Foo's awakeFromInsert I do a fetch to find the Bars. But this results in bizarre problems, like the new Foo appearing twice in a tableview (as Michael reported at the start of this thread). Even if I do the fetch but don't actually use the results it's still problematic. Commenting out the one line that calls executeFetchRequest fixes it. (Yes, this is a reply to a month-old thread...) <http://www.cocoabuilder.com/archive/message/cocoa/2008/4/8/203611> -- ____________________________________________________________ Sean McBride, B. Eng [EMAIL PROTECTED] Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada _______________________________________________ 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]