NSRangeException indexSet count或lastIndex不得超过-numberOfAssets

时间:2014-09-04 09:46:10

标签: objective-c nsrangeexception

我有一个来自我们团队的老成员的新项目。 我不知道问题出在哪里......

  // Chooses the photo at the last index
    [group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:[group numberOfAssets] - 1] options:0 usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop) {

        // The end of the enumeration is signaled by asset == nil.
        if (alAsset) {
            ALAssetRepresentation *representation = [alAsset defaultRepresentation];
            [defaults setObject:representation.filename forKey:@"latest"];
        }
    }];
} failureBlock: ^(NSError *error) {
    // Typically you should handle an error more gracefully than this.
    NSLog(@"No groups");
}];

2014-09-04 11:37:55.960 IMDropShare [28350:60b]警告:GoogleAnalytics 3.06 void GAIUncaughtExceptionHandler(NSException *)(GAIUncaughtExceptionHandler.m:49):未捕获的异常:indexSet count或lastIndex不得超过-numberOfAssets 2014-09-04 11:38:00.980 IMDropShare [28350:60b] * 由于未捕获的异常终止应用程序' NSRangeException',原因:' indexSet count或lastIndex必须不超过-numberOfAssets'

1 个答案:

答案 0 :(得分:0)

问题是,图书馆里没有照片......

对于我的问题,我添加了一些照片并解决了它!