I have a few values in a function, which get in that function, that I need in another function.
These are the values.
NSString *latitude = [NSString stringWithFormat:@"%f", newLocation.coordinate.latitude];
NSString *longitude = [NSString stringWithFormat:@"%f", newLocation.coordinate.longitude];
NSString *stringFromDate = [formatter stringFromDate: newLocation.timestamp];
I need these in another function to send them to my database every time they have found a new location.
Does anybody know how to fix it?
I assume you are using the CLLocationManagerDelegate?
So when a new location is found its send to this method:
from there you can call your method that writes the values to the database and pass you’re values in as parameters. E.g.: