如果我在我的数据库中的照片库 (ALAsset) 中保留照片图像的 url 几天,我怎么知道这张照片仍然存在于照片库中的 NSURL?
我已经尝试过了,但没有奏效:
// Have already obtained the asset object from ALAssetsLibrary
NSURL *assetURL = [[(ALAsset*)asset defaultRepresentation] url];
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath: [assetURL absoluteString]];
NSLog(@"exists: %d (%@)", exists, [assetURL absoluteString]);
>> exists: 0 (assets-library://asset/asset.PNG?id=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&ext=PNG)