0

I'm trying to get the location of a photo via iOS 8's photo library.
The doc says that the PHAsset class has a 'location' attribute.

enter image description here

So I tried to view the 'location' via Xcode v6.3 attached to my iTouch running iOS 8.3... assessing my iTouch photo library:

(lldb) po asset 5C9845F2-6BFD-410B-8222-FFBCE5FFD4A8/L0/001 mediaType=1/0, assetSource=6, (3008x2000), creationDate=2015-04-05 22:40:28 +0000, location=0, hidden=0, favorite=0

(lldb) po asset.creationDate 2015-04-05 22:40:28 +0000

(lldb) po asset.location error: :1:1: error: 'PHAsset' does not have a member named 'location' asset.location ^ ~~~~~~~~

Even though I see the 'location' attribute within the 'asset' object, I can't access it...apparently there's no 'location' data.

Questions:
1) Why does the debugger say PHAsset doesn't have the 'location' attribute when I can see that it does (...having a zero value; and is described in the docs)?

2) Assuming that there's no location data with the photo, how do I make my iTouch's (and iPhone) camera record its location? Note: this is a Wi-Fi based iTouch; not an iPhone.

Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105

2 Answers2

0

Sounds more like a debugger issue. Try

po [asset location]

To record location data, just enable location services for the camera app on your iPod touch.

holtmann
  • 6,043
  • 32
  • 44
0

As per my previous answer you need to import CoreLocation.

Community
  • 1
  • 1
Ron
  • 1,610
  • 15
  • 23