Re: Custom control and cells
Re: Custom control and cells
- Subject: Re: Custom control and cells
- From: Georg Seifert <email@hidden>
- Date: Sat, 10 Jul 2010 02:31:05 +0200
Hi,
> In what way do you believe a custom NSCell-based replication of NSCollectionView will perform better than NSCollectionView itself? What performance issue have you seen? Are you sure the problem lies with NSCollectionView and not your own code surrounding it? (I.e., have you Sharked your application?)
I have Sharked it a lot.
I have bound the CollectionView to a array with several hundred to several thousand items. There is a sidebar which filters the content, displaying a small subset of the content. Every time I change the filter, all previously not visible views are recreated. This may take several seconds. I could mostly avoid this by caching the item and the view (jumping through holes to find out how to do so). One half of the initial loading of the document is taken from the NSCollectionView.
So the main problem is the time the CollectionView needs to archive and deserialize the item view prototype (I even improved this by creating the view in code in newItemForRepresentedObject:).
I just Sharked it and stoped the time again (on Snow Leopard) and it turns out that my optimization does work very well, taking the time to initiate the collectionview from 1 second to <0.1 sec. But the optimization does only work on SL. So all my users with Leopard and PowerPCs (there are several still using them) have to wait.
Saving of the collectionViewItems in the data object (This was one of the holes I jumped through), albite not working to cache the items in Leopard, can be used to get the frame of the view for the item in Leopard. Or is there a (even private) method to get this directly from the collectionView? (I have to check for the systems version number anyway)
Georg
>
>
> --
> michael
>
> On 09 Jul, 2010, at 15:22, Georg Seifert wrote:
>
>> Hi,
>> The thing is, I want to replicate the NSCollectionView but using cells instead of views. The NSCollectionView has a lot of problems like performance and I couldn’t find a way to get the rect of the view of an item (both fixed in Snow Leopard but I have to support Leopard).
>>
>> It would be interesting anyway if I could implement my own controls.
>>
>> Best
>> Georg
>>>
>>> On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:
>>>
>>>> Hi,
>>>>
>>>> I try to find an example on how to implement the mouse tracking and editing behavior of a NSCell from my own control (subclass of NSControl). I need a control that can handle several kinds of cells like ImageAndTextCell (with editing) or popup button cells.
>>>>
>>>> I read a lot about it but can’t fit it together.
>>>
>>> It is probably easiest to just use controls that contain the cells, and not try to make your control directly use multiple cells. With today's hardware, the performance gains are not worth the extra coding effort.
>>>
>>> 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
_______________________________________________
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