2015-10-17 65 views
-1

我正在開發一個應用程序,它使用雲Parse在tableView中顯示數據。我有兩個班,一個叫做Regions,另一個叫City。在這門課上我已經進入了GEOPOINT。我想知道的是,如何計算這些城市與我的位置相比的距離並將其顯示在標籤中。要計算我的位置INTULocationManager使用。謝謝xcode解析PFgeopoint

+0

請提供的模式的截圖或有關架構的結構多一些書面的細節和你已經有代碼。 – Kumuluzz

回答

0

這是截圖enter image description here

- (PFQuery *)queryForTable 
{ 
    PFQuery *query = [PFQuery queryWithClassName:self.parseClassName]; 
    [query whereKey:@"Nome_regione" equalTo:@"Abruzzo"]; 


    return query; 
} 


`and this is the code i use:`- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object 
{ 
    static NSString *simpleTableIdentifier = @"FalesieCell"; 

    DVCittaTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 
    if (cell == nil) { 
     cell = [[DVCittaTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; 
    } 


    // Configure the cell 

    cell.nomeCitta.text = [object objectForKey:@"Nome_citta"]; 

    cell.numeroSettori.text = [object objectForKey:@"numero_settori"]; 

    PFGeoPoint *loc = [object objectForKey:@"location"]; 

`