views:

659

answers:

1

I've finally finished my first large application, the only problem is that I've focued a lot on design, and I'm using custom nibs as cells with transparent backgrounds. When I tried testing the application on my iPhone, the performance was terrible.

Is there any way to get better scrolling performance while using transparent cells with a ImageView behind the UITableView?

I've read two articles mostly:
blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/ cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html

Looks good, but what if I want to use transparent cells?
a) Uses solid color.
b) Uses imageview as background.

Any help will be greatly appreciated. I want to get this baby released as soon as possible, but the performance as it is now is terrible!

A: 

First off, stop using nibs. Every time a cell is created, you're now hitting the disk in order to unarchive the nib. 3.1 will actually make this better, but until then, please create your cell in code.

Secondly, remove transparency wherever you can. Anything that doesn't need to be transparent, shouldn't be. And anything that isn't transparent should have the opaque property set to YES.

A third suggestion is if you're using a lot of subviews, you will see a performance benefit by using a custom view to draw everything instead of a bunch of subviews. If you choose to go this route, you should consider how it behaves when rotating to landscape mode (e.g. how the stretch action occurs), or if you have any controls that need to handle touches separately from the cell itself.

Kevin Ballard