On 30-Aug-2009, at 11:24, Graham Cox <graham....@bigpond.com> wrote:




I believe the issue lies in the fact that an object that has KVO observers registered on it is not the object you think it is. It's in fact a sort of proxy for the "real" object that has been swizzled (you can see this in the debugger as the class will be KVONotifying_Whatever). When the last observer is removed it's swizzled back to the original class. The question would be just how possible/safe this would be to do in -dealloc.


I didn't know the object was unswizzled again when the last observer is removed, but I can see how it might be.

Nevertheless, I think it's a moot point. Apple have decreed that removing observers in dealloc is too late; it flags a fairly stern warning about doing it - a warning that got much more strongly worded between 10.4 and 10.5.

Where? Where have they decreed this? That's what I'm missing. If you're using the fact of the message being logged then please can you explain the release note which I didn't find but did copy/paste into my last mail. As far as my reading of it says, it covers exactly the original poster's situation and says unregistation in that way is fine and the warning message being logged was a bug.

One way or another, I think Andreas has to re-jig his design.

--Graham


_______________________________________________

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 arch...@mail-archive.com

Reply via email to