2010-09-10 11 views
2

Je chargement d'un UITableViewCell utilisant,Est-il correct d'initialiser un UITableViewCell en utilisant initWithCoder?

[[NSBundle mainBundle] loadNibNamed:@"BlogCell" owner:self options:nil]; 
cell = blogCell; 
self.blogCell = nil; 

blogCell est une sortie à BlogCell.xib

La UITableViewCell réelle est de type BlogCell qui est une sous-classe de UITableViewCell.

Dans mon BlogCell classe J'utilise

-(id)initWithCoder:(NSCoder *)aDecoder { 
    self = [super initWithCoder:aDecoder]; 

    //initialisation of some cell properties here 

    return self; 
} 

Est-ce exact? Est-ce la façon dont vous aborderiez l'initialisation d'une cellule chargée à partir d'une plume?

Merci

Répondre

4

Ce ou dans awakeFromNib.

+0

Ah oui cela fonctionne - merci. – dianovich