iOS 开发实用技术导航
NSHipster 中文版
› http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
› http://www.cocos2d-iphone.org/
CocoaPods
› http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
› http://code.google.com/mobile/analytics/
WWDC
› https://developer.apple.com/wwdc/
Design Guides and Resources
› https://developer.apple.com/design/
Transcripts of WWDC sessions
› http://asciiwwdc.com
Cocoa with Love
› http://cocoawithlove.com/
Cocoa Dev Central
› http://cocoadevcentral.com/
NSHipster
› http://nshipster.com/
Style Guides
› Google Objective-C Style Guide
› NYTimes Objective-C Style Guide
Useful Tools and Services
› Charles Web Debugging Proxy
› Smore
sicongliu
V2EX  ›  iDev

CLLocation 和 CLLocationCoordinate2D 有什么区别?

  •  
  •   sicongliu · Jul 16, 2015 · 7786 views
    This topic created in 4094 days ago, the information mentioned may be changed or developed.
    请问CLLocation和CLLocationCoordinate2D有什么区别?如何互相转换
    2 replies  •  2015-07-16 16:16:52 +08:00
    yiplee
        1
    yiplee  
       Jul 16, 2015
    搜官方文档看看吧 CLLocationCoordinate2D 是一个 C 结构体,包含经度和纬度两个值,而 CLLocation 是一个 objc object,不止有经纬度。
    yiplee
        2
    yiplee  
       Jul 16, 2015
    相互转换的话

    ``` objc
    double latitude = 33;
    double longitude = 33;

    CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
    CLLocationCoordinate2D coordinate = location.coordinate;

    CLLocationCoordinate2D _coordinate = (CLLocationCoordinate2D){latitude,longitude};

    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2486 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 02:04 · PVG 10:04 · LAX 19:04 · JFK 22:04
    ♥ Do have faith in what you're doing.