views:

185

answers:

1

For iPhone 4 , a lot API can not be used any more.

I am looking for alternative solution for UIImageWriteToSavedPhotosAlbum.

ALAssetsLibrary is current solution from Apple in new iOS 4.

Anyone has experience for that and can give some samples, or open source projects ?

Thanks

+1  A: 

you need to do something like this -

ALAssetsLibrary* library=[[ALAssetsLibrary alloc] init] ; 
// Request to save the image to camera roll
[library writeImageToSavedPhotosAlbum:img.CGImage orientation:(ALAssetOrientation)img.imageOrientation 
    completionBlock:^(NSURL* assetURL, NSError* error) {
        if (error != NULL)
            // Show error message...
        else  // No errors
            // Show message image successfully saved
    }] ;

Although I'm going crazy trying to figure out how to keep this code compatible with iphone 3 SDK.

maha
Ahhh..figured that out as well, simply weak link the AssetsLibrary.framework
maha