Quote:
Originally Posted by Chobie
Why not just generate a random number between the range of a valid lat and long.
Code:
int lat = (arc4random() % 180) - 90;
int long = (arc4random() % 360) - 180;
Remember that lat's range is -90 to 90 and long is -180 to 180.
It is also possible to get arc4random to return a floating point precision value if you so fancy but I think the above solution is more than enough for your needs.
|
First of all, thank you for your fast answer.
Maybe I wasn't clear enough with my problem. What I need is to click in the map to get the coordinates of the clicked position. What I meant with "random" was any position in the map different from mine.
Sorry for not being clear, I'll make this thing clear in the first post.