mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
save _replacedKeys on the class in stead of the object instance
reviewed: Ross
This commit is contained in:
committed by
Ross Boucher
parent
51f780b5f5
commit
ff8e5ae42e
@@ -213,7 +213,6 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
|
||||
|
||||
_targetObject = aTarget;
|
||||
_nativeClass = [aTarget class];
|
||||
_replacedKeys = [CPSet set];
|
||||
_observersForKey = {};
|
||||
_changesForKey = {};
|
||||
_observersForKeyLength = 0;
|
||||
@@ -230,6 +229,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
|
||||
if (existingKVOClass)
|
||||
{
|
||||
_targetObject.isa = existingKVOClass;
|
||||
_replacedKeys = existingKVOClass._replacedKeys;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -237,6 +237,9 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
|
||||
|
||||
objj_registerClassPair(kvoClass);
|
||||
|
||||
_replacedKeys = [CPSet set];
|
||||
kvoClass._replacedKeys = _replacedKeys;
|
||||
|
||||
//copy in the methods from our model subclass
|
||||
var methodList = _CPKVOModelSubclass.method_list,
|
||||
count = methodList.length,
|
||||
@@ -293,6 +296,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
|
||||
var theMethod = class_getInstanceMethod(_nativeClass, theSelector);
|
||||
|
||||
class_addMethod(_targetObject.isa, theSelector, theReplacementMethod(aKey, theMethod), "");
|
||||
[_replacedKeys addObject:aKey];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user