Meine Foto-Erweiterung App hat Zugriff auf Kamera und Fotos. Alles ist in Ordnung, aber wenn Done gedrückt wird, kann es Bild nicht speichern.iOS-Foto-Erweiterung finishContentEditingWithCompletionHandler: Speichern nicht möglich
Code of Standard Abschluss-Handler:
- (void)finishContentEditingWithCompletionHandler:(void (^)(PHContentEditingOutput *))completionHandler {
// Update UI to reflect that editing has finished and output is being rendered.
// Render and provide output on a background queue.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
PHContentEditingOutput *output = [[PHContentEditingOutput alloc] initWithContentEditingInput:self.input];
NSError* error = nil;
NSData *renderedJPEGData = UIImageJPEGRepresentation(filtered_ui_image, 1.0);
assert(renderedJPEGData != nil);
//BOOL written_well = [renderedJPEGData writeToURL:output.renderedContentURL atomically:YES];
BOOL written_well = [renderedJPEGData writeToURL:output.renderedContentURL options:NSDataWritingAtomic error:&error];
assert(written_well);
// Call completion handler to commit edit to Photos.
completionHandler(output);
});
}
renderedJPEGData
ist nicht nil
,
error
nil
ist, also Funktion [NSData writeToURL]
erfolgreich war,
written_well
YES
ist,
beim Debuggen Line-by- Zeile, nach Blockende erscheint eine Warnung:
output.renderedContentURL
ist /private/var/mobile/Containers/Data/PluginKitPlugin/509C1A04-D414-4DB7-B1E6-83C47FC88BC9/tmp/blah_blah_name.JPG
Also, ich Berechtigungen haben, Debug keine Fehler zeigt, was kann ich versuchen, die Ursache des Problems zu erkennen?