Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 39

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
02/22/15 08:37 PM (9 years ago)

Ultimate Screen Creator -how to remove image from image element

Have a screen with an image several labels, text and buttons which are saved. Added an erase button and was able to clear the textFields. However can not figure out how to remove the onscreen image after deleting the file. Seems to be reading from cache?? [BT_fileManager deleteFile: @"myImageName.png"]; // deletes local file (where myImageName is the Element Name) However image remains onscreen. Thought about replacing with blank.png [BT_fileManager getImageFromFile:@"blank.png"] but don't know how to reference the image? myImageName.image = [BT_fileManager getImageFromFile:@"blank.png"] ; //is a Fail
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/22/15 08:58 PM (9 years ago)
did you try: myImageName.image = NULL; OR: myImageName.image = [UIImage imageNamed:@"bt_blank.png"];
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/23/15 06:01 AM (9 years ago)
I had tried the 2nd. However both error with: Use of undeclared identifier 'myImageName'
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/23/15 06:55 AM (9 years ago)
How are you getting a reference to the UIImageView myImageName? Look at other post from yesterday on how to reference objects on the screen.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/23/15 06:27 PM (9 years ago)
Well.... I was referring to the element as a UIImage not a UIImageView it worked: UIImageView *myImageName = [arrayOfElements objectAtIndex:myElementNumberAvatar]; myImageName.image = NULL; also deleted the file [BT_fileManager deleteFile: @"myImage.png"]; // delete local file
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.