search

Home  >  Q&A  >  body text

objective-c - How to query key

PHFetchResult * reuslt = [PHAsset fetchAssetsWithOptions:nil];

[reuslt enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
    
    PHAsset * imageT = (PHAsset *)obj;
    
    if (imageT.mediaType == PHAssetMediaTypeImage ) {
        
       NSLog(@"照片名%@", [imageT valueForKey:@"filename"]);
    }
    
    NSLog(@"======%@",obj);
}];

As shown in the above code, where can I find the key string behind valueForKey? I will check in the document to see if there is no key for this filename

伊谢尔伦伊谢尔伦2834 days ago700

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-02 09:37:40

    http://chipmuck.pub/2016/09/2...

    Regarding the use of PhotoKit, this article may solve your problem.

    reply
    0
  • 高洛峰

    高洛峰2017-05-02 09:37:40

    filename is a private attribute, of course the document does not have it

    reply
    0
  • Cancelreply