cappuccino/cappuccino — pull request #1627 by ggsato (2012-07-21 05:49:13+00:00)
Title: a suggested fix for CPArrayController selection binding failure in retri...

...eving initial selection values

When CPArrayController is bound via *selection* key, initial selection values are not retrieved. Then it ends up with showing empty selection.

But after moving to another index, which calls **setSelectionIndexes:(CPIndexSet)indexes**, it becomes to work correctly.

**setSelectionIndexes:(CPIndexSet)indexes** calls **_selectionDidChange**(CPObjectController) that initiates selection proxy as follows:

``` Objective-J
- (void)_selectionDidChange
{
if (_selection === undefined || _selection === nil)
_selection = [[CPControllerSelectionProxy alloc] initWithController:self];

[_selection controllerDidChange];
[self didChangeValueForKey:@"selection"];
}
```

So I suspect the instantiation of the proxy is the key, and changed that the proxy is instantiated in the constructor.

But how does the instantiation is deferred at all?