I have an image in an UIImageView and want to save it to the device's photos so that it can be ultimately saved as a wallpaper. Although the code compiles without an error the image does not save and I fear that I am doing something wrong when it comes to using 'UIImage' vs 'UIImageView' or something else all together. The name of the image is "Q115birdsfull~iphone.png" and my code thus far is below. What am I doing wrong???
Q115birdsViewController.h
#import <UIKit/UIKit.h>
@interface Q115birdsViewController : UIViewController
{
UIImage *Q115birdsfull;
}
@property (nonatomic, strong) UIImage *Q115birdsfull;
- (IBAction)onClickSavePhoto:(id)sender;
@end
Q115birdsViewController.m
#import "Q115birdsViewController.h"
@interface Q115birdsViewController ()
@end
@implementation Q115birdsViewController
@synthesize Q115birdsfull;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (IBAction)onClickSavePhoto:(id)sender{
UIImageWriteToSavedPhotosAlbum(Q115birdsfull, nil, nil, nil);
}
` Thank you in advance!