FROM : Sean McBride
DATE : Thu May 08 18:15:15 2008
On 4/8/08 3:53 PM, I. Savant said:
>On Tue, Apr 8, 2008 at 3:34 PM, Michael Burns <<email_removed>> 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_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
DATE : Thu May 08 18:15:15 2008
On 4/8/08 3:53 PM, I. Savant said:
>On Tue, Apr 8, 2008 at 3:34 PM, Michael Burns <<email_removed>> 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_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
| Related mails | Author | Date |
|---|---|---|
| Michael Burns | Apr 8, 19:06 | |
| I. Savant | Apr 8, 19:20 | |
| Michael Burns | Apr 8, 20:45 | |
| I. Savant | Apr 8, 21:18 | |
| Michael Burns | Apr 8, 21:34 | |
| I. Savant | Apr 8, 21:53 | |
| Sean McBride | May 8, 18:15 |






Cocoa mail archive

