UIImageWriteToSavedPhotosAlbum crashed in iOS 11

UIImageWriteToSavedPhotosAlbum work well in iOS 9/10

but crashed in iOS 11

what 's problem?


NSData* imgdata = [NSData dataWithContentsOfFile:path];

if (nil != imgdata)

{

UIImage* saveImg = [[UIImage alloc] initWithData:imgdata];

if (nil != saveImg)

{

UIImageWriteToSavedPhotosAlbum(saveImg, nil, nil, nil);

return 1;

}

}

I recommend that you run the app outside of Xcode and then look at the resulting crash report (see Technote 2151 Understanding and Analyzing iOS Application Crash Reports). That might give you a hint as to what’s going wrong. If not, post the crash report here and we can take a look.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I had the same error. In IOS 11 there is a new permission "Privacy - Photo Library Additions Usage Description". Add this permission to your info.plist file.

UIImageWriteToSavedPhotosAlbum crashed in iOS 11
 
 
Q