Closed gic01 closed 4 years ago
@gic01, thanks for opening this issue. Appears to be a bug.
@gic01,
preliminary testing showed that it might not be a bug within this project/CoreGPX, but rather on Xcode. The Date object seems to be printable, meaning it is not nil
, just that Xcode thinks its nil
at debug time.
Could well be the issue described here: https://stackoverflow.com/questions/58255887/xcode-11-swift-dateformatter-always-return-nil
Try inserting
print(gpx.tracks.first?.tracksegments.first?.trackpoints.first?.time)
at line 255, and see if it prints out the first track's first track segment's first track point's time.
Hello @vincentneo, your comments absolutely helped me move on. I confirm that the date actually gets correctly parsed and I can access it. It simply was what, as you found, appears to be a (maybe just cosmetic) bug on Xcode's debugger. Thanks a lot for getting back on this and sorting it out!
No problem!
What a great project this is! I have one question or issue though: when loading the data of a saved gpx file, I like to access and process the time values of the gpx object (as anchored in the tracks[].tracksegments[].trackpoints[].CoreGPX.GPXElement node). But - when I set a breakpoint after line 250 in the GPXFilesTableViewController.swift code to inspect the gpx object - the time values are all set to (Date?)nil. This seems like the end of story for me, because I have no way now to process the time information of the parsed gpx file. May I ask how I can access the time data? I like to access the time information of gpx files so that not only the route gets loaded into the map after the file-load action, but I can also report the time duration, the average speed and related details. I am a cyclist and started using the Open GPX Tracker for my rides.