mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
fix(Foundation): implement valueForKey: for CPSet KVC compliance
Resolves testKVCCountSetOperators failure in CPSetTest. The previous implementation lacked an override for valueForKey:, causing the runtime to fall back to the default CPObject behavior, which failed to recognize KVC collection operators (e.g., @count). Delegating valueForKey: to valueForKeyPath: ensures that CPSet correctly routes KVC operations through the existing collection operator logic.
This commit is contained in:
1 parent
a240d312d0
commit
da3b0b5e21
1 file changed
+8
@@ -226,6 +226,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (id)valueForKey:(CPString)aKey
|
||||
{
|
||||
// If the key starts with @, it is an operator path.
|
||||
// If not, it is a property path that we want applied to all members.
|
||||
// In either case, valueForKeyPath: handles both scenarios correctly.
|
||||
return [self valueForKeyPath:aKey];
|
||||
}
|
||||
|
||||
- (void)setValue:(id)aValue forKey:(CPString)aKey
|
||||
{
|
||||
var containedObject,
|
||||
|
||||
Reference in new issue
Block a user