-1

我想 + 和 - 当前经度的一些值:

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

我想将 NSString 或 NSNumber 设为 LatMin、LatMax、LonMin、LonMax。

所以对于 Latmin,我想 - 0.005,LatMax +0.005,LonMin -0.005,LonMax +0.005。

有谁知道如何做到这一点。

提前致谢

4

1 回答 1

2

不是这么简单吗?

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];
于 2012-11-19T08:05:13.613 回答