Re: NSOutlineView selectedRow error?
Re: NSOutlineView selectedRow error?
- Subject: Re: NSOutlineView selectedRow error?
- From: Greg Herlihy <email@hidden>
- Date: Sat, 04 Mar 2006 17:27:57 -0800
- Thread-topic: NSOutlineView selectedRow error?
NSOutlineView inherits from NSTableView, so many useful routines for an
outline table will be found in NSTableView.h, including those that select
rows and columns. So calling selectedRow is not a problem.
How is the data for the table supplied? Through bindings or a outline table
data source? If bindings are used, be sure to bind the outline table's
selectionIndexPaths to the selectionIndexPaths in the NSTreeController. And
if you are using a data source, it sounds like you may have an off-by-one
error.
Greg
On 3/4/06 5:09 PM, "Scott Harper" <email@hidden> wrote:
> Hello, I'm making the following call:
>
> NSImage *ti = [[[templateView tableColumnWithIdentifier:@"Image"]
> dataCellForRow:[templateView selectedRow]] objectValue];
>
> in my code, which retrieves an image contained in the appropriate
> column of the selected row. This seems to work just fine at first,
> but I've noticed several problems.
>
> 1) When I select an item, then select an item higher up on the table,
> it lags about one item selection behind each time. So if I select
> item x, then select x-1, it still pulls the image from x. If I then
> select x-4, it pulls the image from x-1.
>
> 2) If I select an item, then scroll around, then activate the method
> to pull the image, it pulls some COMPLETELY unrelated image from the
> outline view.
>
> I think this probably has something to do with the fact that I'm
> using an NSOutlineView, but I cannot find a method for the outline
> view which chooses the currently selected item/row.
>
> Little help?
> --Scott
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden