I might sound like a noob but I'm having trouble to save the Alpha value of a button. When I click on this button it dissapears with an animation, with this code:
I use the following code to save a textfield, but and I cant figure how to save the setAlpha value of "button1". How can I adapt the code to save this alpha changes? Is it possible?
When the app is opened for the first time on a new device, the "viewDidLoad" loads data from a file, but this file is still blank (no data has been written on it yet), so it is setting all values to 0!
It doesnt matter if on the interface builder I set the alpha to 1, when the app is opened on a new device it will always set the alpha to 0... Any ideas of how can I fix this?
The easiest solution is if the float you get from NSUserDefaults is 0.0, just set the alpha to 1.0 instead. If you really need to store an alpha of 0.0, you will have to add another variable, probably a BOOL, to keep track of whether it's the first time running the app, and set it to 1.0 when running the first time.
The easiest solution is if the float you get from NSUserDefaults is 0.0, just set the alpha to 1.0 instead. If you really need to store an alpha of 0.0, you will have to add another variable, probably a BOOL, to keep track of whether it's the first time running the app, and set it to 1.0 when running the first time.
Thanks, I appreciate your help. Im working on a small puzzle game where a few buttons and labels will disappear and change location, and I must save some data about their current alpha and location, and everything is working so far.