My app track the route taken by a user and then creates a MKPolyline which updates every time the users location changes to show the route taken.
My next step is to store the route taken and save it so that The user can view the route the taken later (similar to runkeeper and other GPS tracking apps).
I've been struggling with this for a few days. First I started looked into storing an array of the locations into NSUserDefaults. To do this I was first converting the individual array objects into an NSValue, but quickly found out that NSValues was not a suitable format to store in NSUserDefaults. I think I'm right in saying that I could potentially store the coordinate values into NSData to be stored in NSUserDefaults but I'm not quite sure how this is done.
After more research I think I have settled on storing the coordinates into Core Data. But I have a few questions on doing this as this the first time I have tried to use Core Data. Would I store the coordinates as individual attributes of Latitude and longitude double values? or can I store them as an array? Then I'm also unsure as to how I would recreate CLLocationCoordinate2D to then rebuild the MKpolyline.
Sorry for the barrage of questions - I've been stuck on this for a while now and its driving me slightly stir crazy!!
Thanks