2012-11-19 6 views
-1

에 번호를 추가 - 일부 값을 현재 경도 :은 + 내가 원하는의 NSNumber

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 또는 LatMin에의 NSNumber, LatMax, LonMin, LonMax 만들고 싶어.

그래서 Latmin에 내가 원하는에 - 0.005, LatMax 0.005 , LonMin -0.005, LonMax 0.005.

누구든지이 작업을 수행하는 방법을 알고 있습니까?

미리 감사드립니다.

답변

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]; 
+0

와우, 그 이유는 나에게 올 didnt가 .. 알아낼 질수 너무 쉽게했다 ... –

+0

@Babboe 그게 전부 전에 나 한테 일어난! 나는 그것을 '코더 블록'이라고 부른다! – MCKapur

+0

하지만 이것을 nsstring으로 변환하는 법도 알고 있습니까 –