Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UIImage* image;
- NSData* imageData = [[NSUserDefaults standardUserDefaults] objectForKey:@"image"];
- if (imageData == (id)[NSNull null] || imageData.length == 0) {
- NSLog(@"image data is %@",imageData);
- image = [UIImage imageNamed:@"defaultIcon.png"];
- }
- else {
- image = [UIImage imageWithData:imageData];
- }
- This is how I am retrieving
- This is how I am saving.
- [[NSNotificationCenter defaultCenter] postNotificationName:@"SwitchToHome" object:nil];
- [[NSUserDefaults standardUserDefaults] setObject:UIImagePNGRepresentation(self.imgView.image) forKey:@"image"];
- [[NSUserDefaults standardUserDefaults] setInteger:self.imgView.image.imageOrientation forKey:@"imageOrientation"];
- [[NSUserDefaults standardUserDefaults] synchronize];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement