是否有ALAssetsLibrary的样本 [英] Is there any sample for ALAssetsLibrary

查看:87
本文介绍了是否有ALAssetsLibrary的样本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于iPhone 4,很多API都不能再使用了。

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

我正在为UIImageWriteToSavedPhotosAlbum寻找替代解决方案。

I am looking for alternative solution for UIImageWriteToSavedPhotosAlbum.

ALAssetsLibrary是Apple在新iOS 4中的最新解决方案。

ALAssetsLibrary is current solution from Apple in new iOS 4.

任何人都有这方面的经验,可以给一些样本或开源项目?

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

谢谢

推荐答案

你需要做这样的事情 -

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
    }] ;

虽然我想弄清楚如何保持此代码与iphone 3 SDK兼容,但我会疯狂。

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

这篇关于是否有ALAssetsLibrary的样本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆