improved cocoa compatibility by _CPKVCArray-proxy inheriting from CPMutableArray, fixed wrong mutable accessors patterns in "CPArray+KVO.j"

This commit is contained in:
Daniel Stolzenberg committed 2010-10-26 12:53:21 +02:00
1 parent 9c7b3475d8
commit b0feeb3d31
1 file changed
+12 -5
+12 -5
View File
@@ -46,7 +46,7 @@
@end
@implementation _CPKVCArray : CPArray
@implementation _CPKVCArray : CPMutableArray
{
id _proxyObject;
id _key;
@@ -72,6 +72,9 @@
SEL _objectAtIndexSEL;
Function _objectAtIndex;
SEL _objectsAtIndexesSEL;
Function _objectsAtIndexes;
SEL _countSEL;
Function _count;
@@ -114,19 +117,19 @@
if ([_proxyObject respondsToSelector:_removeSEL])
_remove = [_proxyObject methodForSelector:_removeSEL];
_replaceSEL = sel_getName(@"replaceObjectFrom"+capitalizedKey+"AtIndex:withObject:");
_replaceSEL = sel_getName(@"replaceObjectIn"+capitalizedKey+"AtIndex:withObject:");
if ([_proxyObject respondsToSelector:_replaceSEL])
_replace = [_proxyObject methodForSelector:_replaceSEL];
_insertManySEL = sel_getName(@"insertObjects:in"+capitalizedKey+"AtIndexes:");
_insertManySEL = sel_getName(@"insert"+capitalizedKey+":atIndexes:");
if ([_proxyObject respondsToSelector:_insertManySEL])
_insertMany = [_proxyObject methodForSelector:_insertManySEL];
_removeManySEL = sel_getName(@"removeObjectsFrom"+capitalizedKey+"AtIndexes:");
_removeManySEL = sel_getName(@"remove"+capitalizedKey+"AtIndexes:");
if ([_proxyObject respondsToSelector:_removeManySEL])
_remove = [_proxyObject methodForSelector:_removeManySEL];
_replaceManySEL = sel_getName(@"replaceObjectsFrom"+capitalizedKey+"AtIndexes:withObjects:");
_replaceManySEL = sel_getName(@"replace"+capitalizedKey+"AtIndexes:with"+capitalizedKey+":");
if ([_proxyObject respondsToSelector:_replaceManySEL])
_replace = [_proxyObject methodForSelector:_replaceManySEL];
@@ -134,6 +137,10 @@
if ([_proxyObject respondsToSelector:_objectAtIndexSEL])
_objectAtIndex = [_proxyObject methodForSelector:_objectAtIndexSEL];
_objectsAtIndexesSEL = sel_getName(_key+"AtIndexes:");
if ([_proxyObject respondsToSelector:_objectsAtIndexesSEL])
_objectsAtIndexes = [_proxyObject methodForSelector:_objectsAtIndexesSEL];
_countSEL = sel_getName(@"countOf"+capitalizedKey);
if ([_proxyObject respondsToSelector:_countSEL])
_count = [_proxyObject methodForSelector:_countSEL];