Is it possible to access a photo's geotag metadata from within the simulator?

一个人想着一个人 提交于 2019-12-02 10:18:58

问题


I've written an app that retrieves a photo's GPS metadata, and it works on my iPhone but doesn't in the simulator. If I drag a photo containing geotags onto the simulator, it gets placed into the photo library. Then, my app issues this code:

ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];
NSDictionary *metadata = [assetRepresentation metadata];

and metadata contains all sorts of items, but not GPS. Is there some trick to getting the simulator to recognize GPS metadata?

Alternatively, what I'm trying to do is run the app in the simulator as many different devices to get screenshots for the App Store. How do you prepare App Store screenshots if your app won't work properly in the simulator?


回答1:


To answer my own question, it appears that GPS metadata is removed from photos when you copy them to the simulator via drag and drop. Once I followed @soulshined's suggestion below (put the photo onto Dropbox and downloaded it from within the simulator) then everything worked perfectly.



来源:https://stackoverflow.com/questions/29129746/is-it-possible-to-access-a-photos-geotag-metadata-from-within-the-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!