ios - Not able to find photos on MBP -
this code can't find photos macbook pro (meta nil). trying test code on mbp. photos exist in iphoto. code works iphone/ipad? if yes, how test code on mbp?
alassetslibrary* library = [[alassetslibrary alloc] init]; [library enumerategroupswithtypes:alassetsgroupall usingblock:^(alassetsgroup *group, bool *stop) { if (group) { [group setassetsfilter:[alassetsfilter allphotos]]; [group enumerateassetsusingblock:^(alasset *asset, nsuinteger index, bool *stop){ if (asset){ nsdictionary *meta = [[asset defaultrepresentation] metadata]; } }]; } } failureblock:^(nserror *error) { nslog(@"error enumerating assetlibrary groups %@\n", error); }];
alassetslibrary
only available ios. assume you're running ios app in simulator, right? ios apps running in simulator or device can't access native mac resources, due app sandboxing, , other similar reasons.
Comments
Post a Comment