J'essaie d'utiliser un UITableViewCell personnalisé et je l'ai placé dans le même fichier nib que le contrôleur UITableView. Pour cela, les fichiers sont: NTItems.h, NTItems.m et NTItems.xib.La cellule personnalisée échoue juste
J'ai défini la cellule dans le fichier d'en-tête:
IBOutlet UITableViewCell *cellview;
et je l'ai appliqué correctement la propriété: nonatomic, Fidéliser il est donc là:
@property (nonatomic, retain) IBOutlet UITableViewCell *cellview;
Dans le fichier m - I J'ai synthétisé le périphérique variable et j'utilise ceci pour obtenir la cellule personnalisée:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"cellview";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = self.cellview;
}
Product *aProduct = [appDelegate.products objectAtIndex:indexPath.row];
name.text = aProduct.name;
upc.text = [NSString stringWithFormat:@"UPC%@",aProduct.upc];
price.text = aProduct.pid;
return cell;
}
Cependant, quand je charger la table, je reçois ce gâchis horrible
alt text http://dl.dropbox.com/u/1545603/tablecellissue.png
Il devrait y avoir plus de 1 cellule montrant les données aussi bien. Il semble que seules les dernières données apparaissent en ce moment.
Si vous pouviez fournir un peu plus de code contextuel, ce serait génial. –
Oui, ajouté plus :) – bear