disable value caching in CPControllerSelectionProxy

More information here http://groups.google.com/group/objectivej-dev/browse_thread/thread/c100f16095073332.
This commit is contained in:
Klaas Pieter Annema
2010-11-24 14:27:59 +01:00
parent 21c2b8f74a
commit 8345788e59
2 changed files with 17 additions and 5 deletions
+17
View File
@@ -312,6 +312,22 @@
[[self arrayController] setValue:@"280North" forKeyPath:@"selection.department.name"];
[self assert:@"280North" equals:[departmentNameField stringValue]];
[[self arrayController] setSelectionIndexes:[CPIndexSet indexSetWithIndex:1]];
[[self arrayController] valueForKeyPath:@"selection.department.name"];
[[self arrayController] valueForKeyPath:@"selection.department.building"];
[[self arrayController] valueForKeyPath:@"selection.department"];
var employee = [[[self arrayController] selectedObjects] lastObject],
department = [Department departmentWithName:@"Meh"];
[department setBuilding:@"Building 1"];
[employee setDepartment:department];
[self assert:@"Meh" equals:[departmentNameField stringValue]];
[self assert:department equals:[[self arrayController] valueForKeyPath:@"selection.department"]];
[self assert:@"Building 1" equals:[[self arrayController] valueForKeyPath:@"selection.department.building"]];
}
- (void)observeValueForKeyPath:keyPath
@@ -363,6 +379,7 @@
@implementation Department : CPObject
{
CPString _name @accessors(property=name);
CPString _building @accessors(property=building);
}
+ (id)departmentWithName:(CPString)theName