1
瞭解如何從iOS設備與鏈路的最後一張照片下面檢索最後幾張照片從iPhone
How to retrieve the most recent photo from Camera Roll on iOS?
,但我想找回過去的20張左右就可以,因爲我不想放慢下的性能,以及讓用戶查看他們的照片以相反的順序,而不是
我試圖
long index = group.numberOfAssets - 2;
,結束瓦特第i此錯誤
終止應用程序由於未捕獲的異常 'NSRangeException',原因: '*** - [initWithIndexesInRange的NSIndexSet:]:範圍{4294967294,1}超過NSNotFound的最大指數值 - 1'
任何人都可以幫忙嗎?謝謝
ALAssetsLibrary * library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
***long index = group.numberOfAssets - 2;***
[group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:index]
options:0
usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop)
我明白如何得到最後一張照片。我試圖獲取最後一張照片,但因錯誤而失敗。不太確定NSindexSet限制。 – user1560963 2013-03-07 17:14:47
好吧,這是什麼東西? – 2013-03-07 17:19:33
如果您確定索引一切正常,請添加* NSEnumerationConcurrent *選項 – 2013-03-07 17:20:53