J'affiche plusieurs images dans un UITableViewCell comme une image miniature. Mais j'ai du mal à récupérer l'image de UITableViewCell sélectionné. Je dois le faire pour afficher l'image dans un autre ViewController. J'ai vraiment du mal à résoudre ce problème.Comment faire pour récupérer l'image miniature de UITableViewCell
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MyCell"];
if (cell==nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CellIdentifier"];
}
jsonDict = [jsonArr objectAtIndex:indexPath.row];
//NSLog(@"imagess%@",jsonDict);
cell.textLabel.text = [jsonDict objectForKey:@"ImageName"];
stringg=[NSString stringWithFormat:@"%@",cell.textLabel.text];
cell.textLabel.textAlignment=NSTextAlignmentCenter;
NSData *imgData = [NSData dataWithBase64EncodedString:[jsonDict objectForKey:@"ImageData"]];
imageView.image=[UIImage imageWithData:imgData];
}
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSLog(@"%@",cell);
NSString *textname=[NSString stringWithFormat:@"%@",cell.textLabel.text];
NSLog(@"%@",textname);
UIImage *image1 =selectedCell.imageView.image;
age.ageimgae=image1;
}
ont u montrent la capture d'écran de la page et le code pour l'image en cellforatindexpath et didselectrowatindexpath –
vérifier maintenant ... @ Anbu.Karthik –
avez-vous voir la capture d'écran de la page –