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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -