i'm using this function to save image in Album :
UIImageWriteToSavedPhotosAlbum([UIImage imageNamed:@"Icon-29.png"], self,@selector(thisImage:hasBeenSavedInPhotoAlbumWithError:usingContextInfo:) , nil);
it's work other project but not work in my application and give me error :
Error Domain=ALAssetsLibraryErrorDomain Code=-3310 "Data unavailable" UserInfo={NSLocalizedRecoverySuggestion=Launch the Photos application, NSUnderlyingError=0x14dcec40 {Error Domain=ALAssetsLibraryErrorDomain Code=-3310 "Data unavailable" UserInfo={NSLocalizedRecoverySuggestion=Launch the Photos application, NSUnderlyingError=0x1ab52eb0 {Error Domain=com.apple.photos Code=-3001 "(null)"}, NSLocalizedDescription=Data unavailable}}, NSLocalizedDescription=Data unavailable}
And also app in not in Photos
section in Setting
:
Settings -> Privacy -> Photos.
But not work in my application.
EDIT :
Getting Same error using PHPhotoLibrary
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:[UIImage imageNamed:@"Icon-29.png"]];
} completionHandler:^(BOOL success, NSError *error) {
if (success) {
}
else {
}
}];
Error :
Error Domain=NSCocoaErrorDomain Code=2047 "Photos Access not allowed (authorization status 0)" UserInfo={NSLocalizedDescription=Photos Access not allowed (authorization status 0)}
When i create new project than it working fine, but not in my app ! I also change bundle id to create new app in device, and also reset setting for permission.