Re: Want NSTableView NSOutlineView to load lazy like iOS?
Re: Want NSTableView NSOutlineView to load lazy like iOS?
- Subject: Re: Want NSTableView NSOutlineView to load lazy like iOS?
- From: Ken Thomases <email@hidden>
- Date: Mon, 15 Sep 2014 16:54:43 -0500
On Sep 15, 2014, at 3:54 PM, Jerry Krinock <email@hidden> wrote:
> On 2014 Sep 15, at 12:47, Ken Thomases <email@hidden> wrote:
>
>> In particular, from the docs for -[NSOutlineViewDelegate outlineView:sizeToFitWidthOfColumn:]:
>>
>> "By default, NSOutlineView iterates every row in the table, accesses a cell via preparedCellAtColumn:row:, and requests the cellSize to find the appropriate largest width to use.
>>
>> For accurate results and performance, it is recommended that this method is implemented when using large tables. By default, large tables use a monte carlo simulation instead of iterating every row.”
>
> Those two paragraphs don’t make much sense to me, Ken. For starters, when does NSOutlineView “iterate every row”? I mean, this is a delegate method. There is no default implementation.
NSOutlineView would iterate every row if the delegate does not implement this method and it needs to figure out how wide a column should be.
> Further up, it says that this method is "Invoked to allow the delegate to provide custom sizing behavior when a column’s resize divider is double clicked.” I was never even aware of this “feature" :)) and had not implemented this method. Just to test, I implemented it to return CGFloat value 50.0. And, by golly, now when I double-click a column divider, in the table header, the preceding column resizes to 50 points.
>
> I’m still thinking, but I can’t reckon any connection between this and -outlineView:child:ofItem: being sent proactively instead of lazily. Implementing it did not stop the “let’s get every row” craziness with -outlineView:child:ofItem:.
I had thought that the outline view wanted to know its ideal column width upon first showing, but apparently not.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden