280UIKit: Saving Images to Photo Album

Saving Images to the Shared User Photo Album using the UIKIT UIImageWriteToSavedPhotosAlbum() function:

void UIImageWriteToSavedPhotosAlbum (
    UIImage *image,
    id completionTarget,
    SEL completionSelector,
    void *contextInfo);

Usage:

UIImageWriteToSavedPhotosAlbum(
    [theImage retain], 
    self, 
    @selector(image:didFinishSavingWithError:contextInfo:), 
    nil);

// callback when saving is done...
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
    NSLog(@"finished saving");
    [image retain];
}

No 100% sure if the image has to be retained. It also seems to work without retaining and releasing it...

It takes about 3 seconds to save a 480x320 image on an iPhone 3GS. Feels a bit long...