如何在iphone的google places中获得新位置?

如何在iphone的google places中获得新位置?,iphone,location,latitude-longitude,gettime,Iphone,Location,Latitude Longitude,Gettime,先生,我是iPhone开发新手。我需要知道如何在不发送url请求中的latitude和Langtude的情况下获取新位置 NSURL *URL = [NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search /json?location=40.7143528,-74.0059731&radius=10000&types=school&sensor=false&

先生,我是iPhone开发新手。我需要知道如何在不发送url请求中的latitude和Langtude的情况下获取新位置

 NSURL *URL = [NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search           /json?location=40.7143528,-74.0059731&radius=10000&types=school&sensor=false&key=AIzaSyDbiWWIOmc08YSb9DAkdyTWXh_PirVuXpM"];

这是我在这里的代码,我确实通过url请求请求了iat和lang值,现在我需要在没有这两个值的情况下给出。但它应该采用当前值

你的意思是说它应该占用你的设备很长时间???@InderKumarRathore:是的,inder kumar rathore
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[locationManager startUpdatingLocation];

//These are your delegate methods
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
    //if the time interval returned from core location is more than two minutes we ignore it because it might be from an old session
    if ( abs([newLocation.timestamp timeIntervalSinceDate: [NSDate date]]) < 120) {     
        // Make your request here as
         NSString *urlStr = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=%f,%f&radius=10000&types=school&sensor=false&key=AIzaSyDbiWWIOmc08YSb9DAkdyTWXh_PirVuXpM",newLocation.Latitude,newLocation.Longitude];
         NSURL *URL = [NSURL URLWithString:urlStr];

    }
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
    UIAlertView *alert;
    alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[error description] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [alert release];
}