I have a single image that user picks from camera roll. Id like the user to have the facility to save and load the image from a UI Image view. I have image saved in a singleton class at the moment which is fine, until the app stops running or device is restarted.
Can I use something similar to the code i have used for storage a text string, for images? I have tried just changing .text to .image but unsurprisingly no such luck (it was a bit of a reach)
- (IBAction)functionsave:(id)sender {
NSString *savecontents = _function.text;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:savecontents forKey:@"savecontents1"];
[defaults synchronize];
- (IBAction)Functionload:(id)sender {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *loadstring = [defaults objectForKey:@"savecontents1"];
[_function setText:loadstring];