user1370122
user1370122

Reputation: 205

how to stop saving an image to phone album?

I use the UIImageWriteToSavedPhotosAlbum to save the photos to the album.But if the photo is too large it will take a long time to finish saving.So i need an cancel button which can cancel the saving process. But it seems that there is no way to do that.Does anyone know how to do it?

UIImage *tempImage = [[UIImage alloc] initWithContentsOfFile:pPath]; UIImageWriteToSavedPhotosAlbum(tempImage, self, @selector(finishedSavingImage:didFinishSavingWithError:contextInfo:), [file retain]);

Upvotes: 0

Views: 110

Answers (2)

nioq
nioq

Reputation: 3215

Like you pointed out, it doesn't look like there's a documented way to cancel it. Since the saving happens in the background, do you really need a way to cancel it?

You could assume it will eventually succeed and let the user continue to do other stuff in your app right away, perhaps displaying a UIActivityIndicator somewhere in the meantime so the user knows saving is happening in the background.

Upvotes: 1

Pierre
Pierre

Reputation: 11633

You should check the image size before saving it.

Upvotes: 0

Related Questions