mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-22 00:05:01 +00:00
disable value caching in CPControllerSelectionProxy
More information here http://groups.google.com/group/objectivej-dev/browse_thread/thread/c100f16095073332.
This commit is contained in:
1 parent
21c2b8f74a
commit
8345788e59
2 files changed
+17
-5
No files matched your search
@@ -559,11 +559,6 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
|
||||
|
||||
- (id)valueForKeyPath:(CPString)theKeyPath
|
||||
{
|
||||
var value = [_cachedValues objectForKey:theKeyPath];
|
||||
|
||||
if (value !== undefined && value !== nil)
|
||||
return value;
|
||||
|
||||
var values = [[_controller selectedObjects] valueForKeyPath:theKeyPath];
|
||||
value = [self _controllerMarkerForValues:values];
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user