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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -