• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data with NSArrayController Confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data with NSArrayController Confusion


  • Subject: Re: Core Data with NSArrayController Confusion
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 8 May 2008 12:15:15 -0400
  • Organization: Rogue Research

On 4/8/08 3:53 PM, I. Savant said:

>On Tue, Apr 8, 2008 at 3:34 PM, Michael Burns <email@hidden> 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@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Prev by Date: Re: BLOBs, MySQL, hex. Oh my
  • Next by Date: Re: regarding fxPlug plugins
  • Previous by thread: Re: regarding fxPlug plugins
  • Next by thread: An Example NSStatusItem with a menu
  • Index(es):
    • Date
    • Thread