tags:

views:

271

answers:

1

I'm new to Objective C, so this might be a trivial issue:

After initializing a location:

CLLocation *currentPoint = [[CLLocation alloc] initWithLatitude:0 longitude:0]:

how can I change the latitude and longitude later?

A: 

CLLocation objects are immutable (you can't change them). According to the docs:

Typically, you use a CLLocationManager object to create instances of this class based on the last known location of the user’s device. You can create instances yourself, however, if you want to cache custom location data or get the distance between two different coordinate points.

pgb
Thanks, so I'm going to use variables to store the location and make it changeable.