1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
// FirstViewController.m
// Returns cell to render for each row
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = @"tblCellView";
TableCellView *cell = (TableCellView *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"TableCellView" owner:self options:nil];
cell = tblCell;
}
//Voici le Parser du XML
item *aBook = [appDelegate.books objectAtIndex:indexPath.row];
//Creation of d l'image qui va prendre l'URL (aBook.image) comme source
UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:aBook.image]]];
[cell setDescpText2:aBook.title];
[cell setLabelText:aBook.date];
[cell setDescpText:aBook.description];
[cell setProductImage:image];
//Quand jecris le contenu du aBook.image dans une Label, lURl saffiche bien mais limage napparit jamais.
return cell;
} |
Partager