Core Data Minefield

Boisy Pitre boisy at boisypitre.com
Thu Feb 8 18:16:18 PST 2007


On Feb 6, 2007, at 9:29 AM, Scott Stevenson wrote:

>
> On Feb 6, 2007, at 6:35 AM, Boisy Pitre wrote:
>
>> I would expect to see a  
>> NSManagedObjectContextObjectsDidChangeNotification notification on  
>> load by virtue of the fact that managed objects are being inserted  
>> into the managed object context
> [...]
>> There are three keys that can be part of the passed userInfo  
>> dictionary: inserted, updated and deleted.  When loading the data  
>> from the store, are they not being inserted into the managed  
>> object context?
>
> Actually, no. Insert really means "create". If you want an object  
> to do something when it is loaded, you might look at overriding - 
> awakeFromFetch in NSManagedObject.

Scott,

Thanks for responding.  I see your point in that case.  Slight but  
important distinction.

My original problem remains:  class FARM depends on attribute X in  
class ANIMAL.  Can you recommend something that would alert class A  
when class B is loaded and its awakeFromFetch is called?

Boisy


More information about the MacOSX-dev mailing list