ios - Xcode Display Image if there is no image on Imageview -


i need make this

iboutlet uiimageview *imageview; iboutlet uiimageview *imageview2;  if(imageview have no image){  set image @"x"; }else if(imageview2 have no image){  set image @"x"; } 

and save , load code nsuserdefaults

try this

uiimageview *myimageview; if(myimageview.image){ myimageview.image = [uiimage imagenamed:@"myimage1"];   //image exists } else { myimageview.image = [uiimage imagenamed:@"myotherimage"]; //image doesnt exists } //by time image or other set save image [[nsuserdefaults standarddefaults]setobject:myimageview.image forkey:@"myimage"]; 

i dont know if nsuserdefault can set image object coz havnt tried u might exception, best if can save image's name right in if statement using [[nsuserdefaults standarddefaults] setobject:@"imagenameoftheimage" forkey:@"myimagename]"


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -