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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -