When accessing assets in the iPhone, some time users gets this error.
(Invalid attempt to access ALAssetPrivate past the lifetime of its owning ALAssetsLibrary)
so we can initialize our assetLibaray using the following code:
+ (ALAssetsLibrary *)defaultAssetsLibrary {
static dispatch_once_t pred = 0;
static ALAssetsLibrary *library = nil;
dispatch_once(&pred, ^{
library = [[ALAssetsLibrary alloc] init];
});
return library;
}
0 Comment(s)