Мне просто любопытно, что имеет лучшую производительность для установки пользовательского backgroundView UITableViewCell?
Опция 0) Подкласс метода инициализации UITableViewCell
@implementation CustomCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier andReleases:(NSArray*)releases {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tablecell.png"]] autorelease];
}
return self;
}
Опция 1) Метод делегата willDisplayCell
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tablecell.png"]] autorelease];
}