A number of set and array fixes and added tests for unordered accessor pattern in key value coding.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2010-12-25 02:18:02 -08:00
parent 232f1d008d
commit 9b75e37e1f
4 changed files with 97 additions and 6 deletions
+7 -1
View File
@@ -356,6 +356,12 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey",
SEL _memberOfSelector;
}
// This allows things like setByAddingObject: to work (since they use [[self class] alloc] internally).
- (id)initWithObjects:(CPArray)objects count:(CPUInteger)aCount
{
return [[CPSet alloc] initWithObjects:objects count:aCount];
}
- (id)initWithTarget:(id)aTarget key:(CPString)aKey
{
self = [super initWithObjects:nil count:0];
@@ -368,7 +374,7 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey",
_countOfSelector = CPSelectorFromString("countOf" + capitalizedKey);
_enumeratorOfSelector = CPSelectorFromString("enumeratorOf" + capitalizedKey);
_memberOfSelector = CPSelectorFromString("memberOf" + capitalizedKey);
_memberOfSelector = CPSelectorFromString("memberOf" + capitalizedKey + ":");
}
return self;