代码之家  ›  专栏  ›  技术社区  ›  pankaj

convert nsstring to cllcoordinate

  •  0
  • pankaj  · 技术社区  · 14 年前

    i am working on a application where i am saving the coordinates of a location in database now i need to use these coordinates and display the location on a map. Can some one please suggest me how can i change the latitude & longitude stored as NSString to coordinate. 我想要 to use these coordinates to display an anotation on the map.

    先谢谢了。

    1 回复  |  直到 14 年前
        1
  •  2
  •   Nithin    14 年前
       CLLocationCoordinate2D anyLocation = [[CLLocationCoordinate2D alloc] init];
    
       anyLocation.latitude = [latText doubleValue];
    
       anyLocation.longitude  = [lonText doubleValue];
    

    latText and lonText are strings