0
它運作良好,但它並沒有停止。不能停止NSAssetsLibrary
[group enumerateAssetsAtIndexes:set options:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop)
{
CGImageRef imageRef = result.defaultRepresentation.fullResolutionImage;
UIImage *toSend=[UIImage imageWithCGImage:imageRef];
NSLog(@"INDEXX:%d",index); //logged after i stop !
for(int c=0;c<[selectedButtonsTags count];c++)
if((numberOfAssets-1)-index ==[[selectedButtonsTags objectAtIndex:c] integerValue])
{[savedImages addObject:toSend]; NSLog(@"IMAGE IS:%@ index:%d",toSend,index); }
if(index==numberOfAssets-max-1)
{ NSLog(@"OUT!"); //it DO log this !
*stop=YES;
}
}];
它記錄OUT
後,再次登錄index:
垃圾我number`
你必須檢查'結果== nil'或塊'指數== NSNotFound',看到http://stackoverflow.com/questions/15096662/assetslibrary-a-simple-bug一個非常類似的問題。 – 2013-03-16 15:29:36