I have an UITableView showing custom view cells that I've designed in interface builder. It has quite many buttons and labels and a gradient background, which makes the scrolling performance sloppy, it "lags" every time a new cell loads. I've read the guide from the guy who created Tweetie about fast scrolling, and it says it's best to draw everything manually.
Is there any other way to do this? I want to use my .xib file since it's quite tedious work to draw all those components manually.
This is how the cellForRowAtIndexPath: method is implemented:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"ThreadsViewCell";
ThreadViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ThreadViewCell" owner:nil options:nil];
for(id currentObject in topLevelObjects)
{
if([currentObject isKindOfClass:[ThreadViewCell class]])
{
cell = (ThreadViewCell *)currentObject;
break;
}
}
}