-1

I want to + and - some values to the current longitude:

NSNumber *Latitude = [[NSNumber alloc] initWithDouble:location.latitude];
NSNumber *Longitude = [[NSNumber alloc] initWithDouble:location.longitude];

NSLog(@"Numbers:%@ %@", Latitude, Longitude);

2012-11-19 08:31:52.740 SR Navigatie[16748:907] Numbers:52.17401375095112 4.98983223979254

I want to make NSString or an NSNumber to LatMin, LatMax, LonMin, LonMax.

So to Latmin i want to - 0.005, LatMax +0.005, LonMin -0.005, LonMax +0.005.

Does anyone know how to do this.

Thanks in advance

David Raijmakers
  • 1,369
  • 1
  • 16
  • 40

1 Answers1

2

Isn't it this simple?

NSNumber *latMin  = [[NSNumber alloc] initWithDouble:location.latitude -0.005];
NSNumber *latMax = [[NSNumber alloc] initWithDouble:location.latitude +0.005];
NSNumber *lonMin = [[NSNumber alloc] initWithDouble:location.longitude -0.005];
NSNumber *lonMax = [[NSNumber alloc] initWithDouble:location.longitude +0.005];
John
  • 2,672
  • 2
  • 23
  • 29