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