簡體   English   中英

iPhone:以編程方式從相冊中查找視頻和圖像的數量?

[英]iPhone:Programmatically find the count of videos and images from photo album?

我正在iOS 4.3 SDK上開發應用程序。 我想知道如何在“相機”照片庫相冊中找到多少個圖像和視頻。 是否可以通過編程找到一種方法來了解相冊中視頻和圖像的數量?

請指教。

謝謝!

使用ALAssetsLibrary

http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html

有關如何使用它的一個很好的示例,請參見鏈接http://iphonetuts.com/tag/alassetslibrary-tutorial/

27    [library enumerateGroupsWithTypes:ALAssetsGroupAlbum
28                     usingBlock:assetGroupEnumerator
29                   failureBlock: ^(NSError *error) {
30                       NSLog(@"Failure");
31                   }];

用“ ALAssetsGroupSavedPhotos”替換“ ALAssetsGroupAlbum”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM