0
저는 궁금 해서요, UITableViewCell의 사용자 정의 backgroundView를 설정하는 데 더 좋은 성능을 가진 것은 무엇입니까?backgroundView 설정을위한 성능 향상 : willDisplayCell 또는 init?
옵션 0) 서브 클래스있는 UITableViewCell의 init 메소드
@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];
}
질문에 대한 답변을 수락합니다. 이 경우에 나는 네가 한 것을 믿는다. 감사! – Keller