0
我使用的是反向地理編碼,我想保存信息到一個SQLite數據庫,但我需要用戶設置的緯度和經度,但它沒有被通過。 我有兩個雙打VAR所謂的經度和緯度,當我下面執行此代碼,它使用「隨機」雙打:通過VAR爲目標C座
CLLocation *locate = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
CLGeocoder *geoCoderCL = [[CLGeocoder alloc] init];
[geoCoderCL reverseGeocodeLocation: locate completionHandler:
^(NSArray *placemarks, NSError *error) {
CLPlacemark *placemark = [placemarks objectAtIndex:0];
Controller *mController = [[Controller alloc] init];
MyObject *newposition = [[Meeting alloc]init];
[newposition setLatitude:latitude];
[newposition setLongitude:longitude];
[newposition setMName:[NSString stringWithFormat:@"%@ %@",placemark.thoroughfare,placemark.subThoroughfare]];
NSLog(@"%@ %@",placemark.thoroughfare,placemark.subThoroughfare);
[mController createRecentPoint:newposition];
[mController release];
[newposition release];
}];
如何應該這樣做嗎?謝謝。