How to dynamically set image in iOS -
i have following code:
nsmutablearray *arrayimages = [nsmutablearray arraywithobjects:@"camera.jpg",@"washmachine.jpg",@"mixer.jpg",@"tv.jpg",@"mobile.jpg",@"fridge.jpg",@"frock.jpg",@"shirt.jpg",nil]; for(int i=0; i<_devicepricearray.count;i++){ [_devicearray addobject:arrayimages]; }
and in
cellforrowatindexpath :- trying set images [(uiimageview *)[cell viewwithtag:201] setimage:[_devicearray[indexpath.row]];
how set images here? it's saying "expected identifier".
observe line
[(uiimageview *)[cell viewwithtag:201] setimage:[arrayimages[indexpath.row]];
.
here use image name. have pass uiimage
object here. replace below line
[(uiimageview *)[cell viewwithtag:201] setimage:[uiimage imagenamed:arrayimages[indexpath.row]]];
Comments
Post a Comment