是否可以从模拟器中访问照片的地理标记元数据? [英] Is it possible to access a photo's geotag metadata from within the simulator?

查看:77
本文介绍了是否可以从模拟器中访问照片的地理标记元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个应用程序来检索照片的GPS元数据,它可以在我的iPhone上运行,但不能在模拟器中运行.如果将包含地理标签的照片拖到模拟器上,则会将其放置到照片库中.然后,我的应用发出以下代码:

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];

metadata包含各种项目,但不包含GPS.让模拟器识别GPS元数据有什么技巧吗?

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

或者,我想做的是在模拟器中运行该应用程序,就像在许多不同的设备上一样,以获取App Store的屏幕截图.如果您的应用程序无法在模拟器中正常运行,该如何准备App Store屏幕截图?

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?

推荐答案

要回答我自己的问题,当您通过拖放将GPS元数据复制到模拟器中时,似乎会删除GPS元数据.一旦我按照下面的@soulshined的建议(将照片放到Dropbox上并从模拟器中下载),一切都将正常运行.

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.

这篇关于是否可以从模拟器中访问照片的地理标记元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆