开发者

how can pass latitude and longitude values

I am new iphone developer,in this code i find latitude and longitude values i want pass that l开发者_JS百科at,longt values instead of (37.3317 & -122.0307) but is error is coming,please tel me how can i pass lat & longt values instead of integer values

double degrees = newLocation.coordinate.latitude;
NSString *lat = [NSString stringWithFormat:@"%f",degrees];
lable1.text = lat;
degrees = newLocation.coordinate.longitude;
NSString *longt = [NSString stringWithFormat:@"%f",degrees];
lable2.text = longt;
//NSInteger a=[lat doubleValue];

//NSInteger degreess=a;
CLLocationCoordinate2D corde;
corde.latitude=37.3317;
corde.longitude=-122.0307;
MKReverseGeocoder *geocoder=[[MKReverseGeocoder alloc] initWithCoordinate:corde];
[geocoder setDelegate:self];
[geocoder start];


CLLocationCoordinate2D accepts double value for latitude and longitude

corde.latitude = [lat doubleValue];

corde.longitude = [longt doubleValue];

It will work for you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜