Re: Improving speed of NSCollectionView scrolling
Re: Improving speed of NSCollectionView scrolling
- Subject: Re: Improving speed of NSCollectionView scrolling
- From: PCWiz <email@hidden>
- Date: Tue, 8 Dec 2009 21:14:42 -0700
Ok, I think I've solved this problem. Corbin, you're right, the problem is too many subviews.
What I did to counter this problem is to actually draw most images/text in my prototype NSView subclass rather than using subviews like NSImageView and NSTextField. This yielded a pretty noticeable speed increase.
Hope this helps anyone else having similar issues. Key point: just do the drawing yourself.
On 2009-12-08, at 5:31 PM, Corbin Dunn wrote:
>
> On Dec 8, 2009, at 3:40 PM, PCWiz wrote:
>
>> Hi,
>>
>> I am using NSCollectionView for a project in which the collection view is populated with about 200 items, each containing about 4 subviews (image view, and a few text fields).
>
> You may want to consider using a different view. NSCollectionView does not do any special things for views that aren't visible, and you get one view for each item. So, in this case, you have at least 5 * 200 = 1000 views. That's a lot. Try IKImageBrowserView or NSTableView/NSOutlineView.
>
> corbin
>
>
_______________________________________________
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