FROM : Jonathan Dann
DATE : Wed Mar 26 20:49:55 2008
<Repost, forgot to send to the list>
On 26 Mar 2008, at 03:24, Adam Gerson wrote:
> I take that back. [outlineView selectedRow] does appear to tell the
> absolute truth. So I should now be able to try what you said and tie
> the tree controller's @"selectionIndexPaths" to [outlineView
> selectedRow]. I will report back my results...
>
> Adam
Ah.. I'm not quite sure you got what I meant. In a (document-based)
app set up an NSArray *selectionIndexPaths ivar, so the
NSTreeController then binds its @"selectionIndexPaths" binding to the
keypath @"File's Owner.selectionIndexPaths" where file's owner (the
document) is the owner of the nib containing the tree controller and
the outline view. The outline view then has its content bound to the
tree controller's @"arrangedObjects" controller key, the
selectionIndexPaths to the @"selectionIndexPaths" controller key and
then the outline view's table column's @"value" binding is set to the
tree controller's @"arrangedObjects.nodeName" (nodeName is just an
NSString representation of a file path).
Doing what you said may not work.
>> On Tue, Mar 25, 2008 at 10:29 AM, Jonathan Dann
>> <j.p.<email_removed>> wrote:
>>> Have your tried binding the tree controller's @"selectionIndexPaths"
>>> binding to a variable in your model object?
>>>
>>> I havent tried it but it seems that you can do this in IB and then
>>> get
>>> the model to observe the bound instance variable and you cab then
>>> see
>>> each time the variable changes. Not sure if it will cover all the
>>> bases you need though.
>>>
>>> You'd get an array if selection index paths and then just see if the
>>> count of the array is 1 for single selection or more if you have
>>> multiple.
>>>
>>> Jonathan Dann
>>>
DATE : Wed Mar 26 20:49:55 2008
<Repost, forgot to send to the list>
On 26 Mar 2008, at 03:24, Adam Gerson wrote:
> I take that back. [outlineView selectedRow] does appear to tell the
> absolute truth. So I should now be able to try what you said and tie
> the tree controller's @"selectionIndexPaths" to [outlineView
> selectedRow]. I will report back my results...
>
> Adam
Ah.. I'm not quite sure you got what I meant. In a (document-based)
app set up an NSArray *selectionIndexPaths ivar, so the
NSTreeController then binds its @"selectionIndexPaths" binding to the
keypath @"File's Owner.selectionIndexPaths" where file's owner (the
document) is the owner of the nib containing the tree controller and
the outline view. The outline view then has its content bound to the
tree controller's @"arrangedObjects" controller key, the
selectionIndexPaths to the @"selectionIndexPaths" controller key and
then the outline view's table column's @"value" binding is set to the
tree controller's @"arrangedObjects.nodeName" (nodeName is just an
NSString representation of a file path).
Doing what you said may not work.
>> On Tue, Mar 25, 2008 at 10:29 AM, Jonathan Dann
>> <j.p.<email_removed>> wrote:
>>> Have your tried binding the tree controller's @"selectionIndexPaths"
>>> binding to a variable in your model object?
>>>
>>> I havent tried it but it seems that you can do this in IB and then
>>> get
>>> the model to observe the bound instance variable and you cab then
>>> see
>>> each time the variable changes. Not sure if it will cover all the
>>> bases you need though.
>>>
>>> You'd get an array if selection index paths and then just see if the
>>> count of the array is 1 for single selection or more if you have
>>> multiple.
>>>
>>> Jonathan Dann
>>>
| Related mails | Author | Date |
|---|---|---|
| Adam Gerson | Mar 25, 05:18 | |
| Jens Alfke | Mar 25, 05:49 | |
| Adam Gerson | Mar 25, 06:42 | |
| Jonathan Dann | Mar 25, 15:29 | |
| Adam Gerson | Mar 26, 04:12 | |
| Adam Gerson | Mar 26, 04:24 | |
| Jonathan Dann | Mar 26, 20:49 | |
| Adam Gerson | Mar 27, 18:17 | |
| Hamish Allan | Mar 27, 20:07 | |
| Adam Gerson | Mar 30, 09:44 | |
| Jonathan Dann | Mar 31, 22:38 |






Cocoa mail archive

