KVO and isKindOfClass:
KVO and isKindOfClass:
- Subject: KVO and isKindOfClass:
- From: "Timothy J.Wood" <email@hidden>
- Date: Thu, 17 Mar 2005 11:52:49 -0800
On one of my model classes, I have an -isEqual: method that does:
- (BOOL)isEqual:(id)otherObject;
{
if (![otherObject isKindOfClass:[MyClass class]])
return NO;
...
}
But, if this is sent to an object that has been targeted for KVO,
it's isa gets replaced with NSNotifying_MyClass which is NOT a subclass
of MyClass, but instead appears to be a clone of MyClass.
This seems to me to be a pretty big bug in KVO, but I'm wondering if
there is some design reason for this that I'm not considering. It does
make it hard to deal with class membership tests, though since you
might be comparing two objects, one of which has KVO listeners and one
of which doesn't (in either order).
-tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden