Re: Removing object as observer in -willTurnIntoFault
Re: Removing object as observer in -willTurnIntoFault
- Subject: Re: Removing object as observer in -willTurnIntoFault
- From: Sean McBride <email@hidden>
- Date: Mon, 31 Mar 2014 15:02:28 -0400
- Organization: Rogue Research Inc.
On Mon, 31 Mar 2014 04:29:51 -0500, Dado Colussi said:
>> Question: You do some initialization, adding observers for example, in
>> -awakeFromInsert and -awakeFromFetch, and you tear down these
>> initializations, removing observers for example, in -willTurnIntoFault. Do
>> you need to do anything in -awakeFromSnapshotEvents: ?
>
>I don't start observers in -awakeFromInsert or -awakeFromFetch. I start
>them on demand, and in -awakeFromSnapshotEvents: with
>NSSnapshotEventUndoDeletion
>(I ignore the other flags). I think the best place to start observers
>depends on how the objects are used.
I also never start/stop KVO in any of my managed object subclasses. Mismatching KVO start/stop throws exceptions and it always seemed to me there's no bulletproof place to start/stop in the context of managed object lifetimes.
(But I seem to have a pretty different experience vs Jerry. I've found optional and transient to work quite nicely and are quite useful.)
Cheers,
--
____________________________________________________________
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