Dan
Dan

Reputation: 1447

How to store multiple co-ordinates and map kit plot route

I'm currently designing a new application for the iPhone. Basically I would like to track the users movements, store them and the display them later on a map.

What is the best way to store the co-ordinates- a mutable array? Is then possible to plot the route on a map using each coordinate stored?

I have some of experience in iOS dev but never touched the map kit and core locations.

Thanks

Upvotes: 4

Views: 389

Answers (1)

Caleb
Caleb

Reputation: 125007

CLLocationCoordinate2D and MKMaPPoint are both structs, not classes, so you can't store instances of them directly in a NSMutableArray. You can wrap them in an appropriate container if you want, or just use plain old C-style arrays. For the purpose you describe, you might just want to create a MKPolyline from the points and store just that object if you don't need to keep the actual coordinates themselves.

To answer your section question, yes, its possible to plot the route using MKPolyline.

Upvotes: 1

Related Questions