FROM : Adam Gerson
DATE : Wed Mar 26 04:24:27 2008
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
On Tue, Mar 25, 2008 at 11:12 PM, Adam Gerson <<email_removed>> wrote:
> I think the big problem I am having is that an OutlineView doesn't
> always accurately update its index paths to match the selection the
> GUI is displaying. So I dont have accurate information to pass onto
> the tree controller.
>
> Adam
>
>
>
>
> 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
> >
> >
> >
> > On 25 Mar 2008, at 05:42, "Adam Gerson" <<email_removed>> wrote:
> >
> > > Hey Jens,
> > >
> > > Thanks for getting back to me.
> > >
> > >>> When I
> > >>> remove an object from the TreeController the row representing the
> > >>> deleted object disappears and OutlineView selects the next row, but
> > >>> does not send a notification to the delegate method
> > >>> outlineViewSelectionDidChange.
> > >>
> > >> IIRC, the notification is only sent on user-generated selection
> > >> changes. If you programmatically change the selected item (directly
> > >> or
> > >> indirectly) you need to call your observer method manually, if
> > >> necessary.
> > >>
> > >
> > > There are times when this is a problem. My observer method uses the
> > > "currently selected tree node" as the object to work with. However,
> > > after a programatic insert, the inserted object doesn't become the
> > > selected item of the treecontroller. I have selectsInsertedObjects set
> > > to YES. Likewise, after an undo of a delete the outline view
> > > graphically selects the newly resurected object, but that object does
> > > not become the tree controller's selected object.
> > >
> > > What I need is a way to ensure the OutlineView's selection and the
> > > TreeController's selection always are in sync. I thought this was the
> > > promise of bindings.
> > >
> > >>
> > >>> On a separate but related note, when I add an object to the
> > >>> TreeController is there away to get the OutlineView to automatically
> > >>> select the new row?
> > >>
> > >> Check the "Select Inserted Objects" box in the IB inspector for the
> > >> controller.
> > >>
> > > I have this box checked. It appears not to work when I
> > > programmatically insert an object. It does work if I bind a button to
> > > the insert method of the controller.
> > > _______________________________________________
> > >
> > > Cocoa-dev mailing list (<email_removed>)
> > >
> > > Please do not post admin requests or moderator comments to the list.
> > > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> > >
> > > Help/Unsubscribe/Update your Subscription:
> > > http://lists.apple.com/mailman/options/cocoa-dev/j.p.<email_removed>
> > >
> > > This email sent to j.p.<email_removed>
> >
>
DATE : Wed Mar 26 04:24:27 2008
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
On Tue, Mar 25, 2008 at 11:12 PM, Adam Gerson <<email_removed>> wrote:
> I think the big problem I am having is that an OutlineView doesn't
> always accurately update its index paths to match the selection the
> GUI is displaying. So I dont have accurate information to pass onto
> the tree controller.
>
> Adam
>
>
>
>
> 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
> >
> >
> >
> > On 25 Mar 2008, at 05:42, "Adam Gerson" <<email_removed>> wrote:
> >
> > > Hey Jens,
> > >
> > > Thanks for getting back to me.
> > >
> > >>> When I
> > >>> remove an object from the TreeController the row representing the
> > >>> deleted object disappears and OutlineView selects the next row, but
> > >>> does not send a notification to the delegate method
> > >>> outlineViewSelectionDidChange.
> > >>
> > >> IIRC, the notification is only sent on user-generated selection
> > >> changes. If you programmatically change the selected item (directly
> > >> or
> > >> indirectly) you need to call your observer method manually, if
> > >> necessary.
> > >>
> > >
> > > There are times when this is a problem. My observer method uses the
> > > "currently selected tree node" as the object to work with. However,
> > > after a programatic insert, the inserted object doesn't become the
> > > selected item of the treecontroller. I have selectsInsertedObjects set
> > > to YES. Likewise, after an undo of a delete the outline view
> > > graphically selects the newly resurected object, but that object does
> > > not become the tree controller's selected object.
> > >
> > > What I need is a way to ensure the OutlineView's selection and the
> > > TreeController's selection always are in sync. I thought this was the
> > > promise of bindings.
> > >
> > >>
> > >>> On a separate but related note, when I add an object to the
> > >>> TreeController is there away to get the OutlineView to automatically
> > >>> select the new row?
> > >>
> > >> Check the "Select Inserted Objects" box in the IB inspector for the
> > >> controller.
> > >>
> > > I have this box checked. It appears not to work when I
> > > programmatically insert an object. It does work if I bind a button to
> > > the insert method of the controller.
> > > _______________________________________________
> > >
> > > Cocoa-dev mailing list (<email_removed>)
> > >
> > > Please do not post admin requests or moderator comments to the list.
> > > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> > >
> > > Help/Unsubscribe/Update your Subscription:
> > > http://lists.apple.com/mailman/options/cocoa-dev/j.p.<email_removed>
> > >
> > > This email sent to j.p.<email_removed>
> >
>
| 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

