I tried to store CLLocationCoordinate2D
to NSMutableArray
but I could only do it using NSValue
. I want to get those coordinates stored in NSMutableArray
in NSValue
type as CLLocationCoordinate2D
. How can I do that? I am having trouble getting those coordinates since it only pointers.
I tried to store using
[valueArray addObject:[CLLocationCoordinate2DMake(54.860812, -78.990710) ]]
it gives expected identifier error
but I was successfully able to store using NSValue
but I am not able to get the CLLocationCoordinate2D
out of NSValue
.
[valueArray addObject:[NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(54.860717, -78.990722)]];
for (NSValue *object in valueArray)
{
NSLog(@"%@", object]
//return pointers
}
I will appreciate if somebody can help me on this and suggest me which is a better approach of storing CLLocation
in a mutable array.