iOS 8.02中的Bug?如果是库枚举,有什么解决方法吗?
我认为AssetLibrary的group(album)枚举api在ios 8.02上不再有效,enumerateGroupsWithTypes:usingBlock:在枚举所有组时不返回最近添加的组,在调用库组时返回空(记录为://包含所有资产的库组) 这是我的密码iOS 8.02中的Bug?如果是库枚举,有什么解决方法吗?,ios,ios8,alassetlibrary,Ios,Ios8,Alassetlibrary,我认为AssetLibrary的group(album)枚举api在ios 8.02上不再有效,enumerateGroupsWithTypes:usingBlock:在枚举所有组时不返回最近添加的组,在调用库组时返回空(记录为://包含所有资产的库组) 这是我的密码 +(void)loadCameraRollGroupFromAssetLibrary:(ALAssetsLibrary *)assetLibrary withBlock:(void (^)(BOOL hasPermission,
+(void)loadCameraRollGroupFromAssetLibrary:(ALAssetsLibrary *)assetLibrary withBlock:(void (^)(BOOL hasPermission, YLCameraRollGroup *cameraRoll))block {
__block BOOL foundCameraRoll = NO;
[assetLibrary enumerateGroupsWithTypes:ALAssetsGroupLibrary usingBlock:^(ALAssetsGroup *assetsGroup, BOOL *stop) {
if(assetsGroup){
YLCameraRollGroup *group = [[YLCameraRollGroup alloc] initWithAssetsGroup:assetsGroup];
if(group.isCameraroll){
NSLog(@"found camera roll");
*stop = YES; // this fucking stop didn't work, don't know why
foundCameraRoll = YES;
block(YES, group);
return;
}
}
else{
if(!foundCameraRoll){
NSLog(@"no camera roll");
block(NO, nil);
}
}
} failureBlock:^(NSError *error) {
block(NO, nil);
}];
}
-(id)initWithAssetsGroup:(ALAssetsGroup *)assetsGroup{
self = [super init];
if(self){
self.name = [assetsGroup valueForProperty:ALAssetsGroupPropertyName];
NSLog(@"loaded group: %@", self.name);
self.assetsGroup = assetsGroup;
#if TARGET_IPHONE_SIMULATOR
self.isCameraroll = [self.name isEqualToString:@"Saved Photos"];
#else
self.isCameraroll = [self.name isEqualToString:@"Camera Roll"] || [self.name isEqualToString:@"Recently Added"];
#endif
}
return self;
}
这会发生在其他人身上吗
AlassetGroupLibrary:包含从iTunes同步的所有资产的库组
这不是相机卷。不带照相机的设备的照相机卷或保存的照片应位于
ALASSETGROUPS SAVEDPHOTOS
中。我认为他们将其从8.0.2中最近添加的还原回来。使用AlassetGroupAll
枚举时,您看到了哪些组名?我看到了除“最近添加”和“最近删除”之外的所有组。这就是所改变的,在iOS 8.0上它返回了“最近添加的”相册。