Re: table view and custom cell optimization problem
Re: table view and custom cell optimization problem
- Subject: Re: table view and custom cell optimization problem
- From: Quincey Morris <email@hidden>
- Date: Fri, 04 Mar 2011 00:22:12 -0800
On Mar 3, 2011, at 23:54, Nick Rogers wrote:
> But the problem is that I don't have anything common in the rows.
> The image (128x128) are different, the four lines of text are different and the lines I draw are different in each cell.
On 3 Mar 2011, at 04:06, Nick Rogers wrote:
> I have a table view with the custom cell class assigned to its only column in awakeFromNib method using setDataCell:.
> Then I'm doing some drawing in drawInteriorWithFrame: of the NSCell subclass.
> The problem is that drawing include four lines of text and an image and a few lines using NSBezierPath.
>
> This is relatively time consuming and hence when I scroll the table view, the scrolling is not that smooth and is a bit jerky.
>
> Is there a way to do all this custom drawing in a manner that could make the scrolling faster.
There's no particular reason why the drawing tasks you've described should be so slow as to interfere with scrolling, unless (for example) it's hitting the disk for every row.
You have to find out why it's slow. Optimizing drawing that turns out not to be the problem is going to be an exercise in frustration, so better not to do that. This sounds like a job for Instruments.
Or, you could certainly start by commenting out various parts of your drawing code and seeing if there's any obvious culprit.
In this case, "what" needs to come before "why" and both of them before "how else". :)
_______________________________________________
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