├── 屏幕快照 2017-04-14 14.14.54.png ├── 屏幕快照 2017-04-14 14.15.09.png ├── simulatorLocation.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcuserdata │ └── zhang.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── simulatorLocation.xcscheme └── project.pbxproj ├── simulatorLocation ├── Location.gpx ├── ViewController.h ├── AppDelegate.h ├── main.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.m ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── MSManageLocation.h ├── AppDelegate.m └── MSManageLocation.m ├── simulatorLocationTests ├── Info.plist └── simulatorLocationTests.m ├── simulatorLocationUITests ├── Info.plist └── simulatorLocationUITests.m └── README.md /屏幕快照 2017-04-14 14.14.54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangmengsai/SimulatorLocation/HEAD/屏幕快照 2017-04-14 14.14.54.png -------------------------------------------------------------------------------- /屏幕快照 2017-04-14 14.15.09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangmengsai/SimulatorLocation/HEAD/屏幕快照 2017-04-14 14.15.09.png -------------------------------------------------------------------------------- /simulatorLocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /simulatorLocation/Location.gpx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Cupertino 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /simulatorLocation/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /simulatorLocation/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /simulatorLocation/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /simulatorLocationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /simulatorLocationUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /simulatorLocation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /simulatorLocation.xcodeproj/xcuserdata/zhang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | simulatorLocation.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1F67A88A1EA075E9001698AA 16 | 17 | primary 18 | 19 | 20 | 1F67A8A31EA075E9001698AA 21 | 22 | primary 23 | 24 | 25 | 1F67A8AE1EA075E9001698AA 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /simulatorLocation/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "MSManageLocation.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | // 117.31189,40.038887 21 | 22 | CLLocationCoordinate2D location = [MSManageLocation gcj02ToWgs84:CLLocationCoordinate2DMake(40.038887, 116.31189)]; 23 | NSLog(@"lat = %f \nlon = %f" ,location.latitude,location.longitude); 24 | 25 | } 26 | 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /simulatorLocationTests/simulatorLocationTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // simulatorLocationTests.m 3 | // simulatorLocationTests 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface simulatorLocationTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation simulatorLocationTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /simulatorLocation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /simulatorLocationUITests/simulatorLocationUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // simulatorLocationUITests.m 3 | // simulatorLocationUITests 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface simulatorLocationUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation simulatorLocationUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimulatorLocation 2 | 3 | 4 | 5 | 6 | 7 | 8 | 模拟器的模拟定位 9 | 10 | 11 |

模拟器的模拟定位

12 | 13 |

1、提供各种国际坐标与国内坐标的转换 ,国际使用的坐标是WGS-84,高德使用的火星坐标(GCJ-02),百度使用的是自己的坐标(BD-09)。

14 | 15 |

2、在国内可以选取地点测量目标地方的经纬度,百度高德

16 | 17 |

3、iPhone所需要的坐标是WGS-84,我们获取的是GCJ-02或者BD-09,这里我们利用最新上述函数算法来转换出你所需要的真实坐标。

18 | 19 |

4、创建gpx文件,包含坐标用于模拟定位。

20 | 21 |

<?xml version="1.0"?>

22 | 23 |

<gpx version="1.1" creator="Xcode">

24 | 25 |

<wpt lat="40.0376005351439" lon="117.305775621126">

26 | 27 |

<name>Cupertino</name>

28 | 29 |

<time>2014-09-24T14:55:37Z</time>

30 | 31 |

</wpt>

32 | 33 |

</gpx>

34 | 35 |

5、在上述的gpx文件中输入转换后的坐标。

36 | 37 |

6、在工程运行前需要加载gpx文件

38 | 39 |

方式一

40 | 41 |

方式二

42 | 43 |

7、连接真机的时候自己的当前位置就是gpx文件中的经纬度显示的位置, 取消模拟定位 stop 工程 或者拔掉数据线。

44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /simulatorLocation/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simulatorLocation/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /simulatorLocation/MSManageLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MSManageLocation.h 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | 14 | @interface MSManageLocation : NSObject 15 | /** 16 | * @brief 世界标准地理坐标(WGS-84) 转换成 中国国测局地理坐标(GCJ-02)<火星坐标> 17 | * 18 | * ####只在中国大陆的范围的坐标有效,以外直接返回世界标准坐标 19 | * 20 | * @param location 世界标准地理坐标(WGS-84) 21 | * 22 | * @return 中国国测局地理坐标(GCJ-02)<火星坐标> 23 | */ 24 | + (CLLocationCoordinate2D)wgs84ToGcj02:(CLLocationCoordinate2D)location; 25 | 26 | 27 | /** 28 | * @brief 中国国测局地理坐标(GCJ-02) 转换成 世界标准地理坐标(WGS-84) 29 | * 30 | * ####此接口有1-2米左右的误差,需要精确定位情景慎用 31 | * 32 | * @param location 中国国测局地理坐标(GCJ-02) 33 | * 34 | * @return 世界标准地理坐标(WGS-84) 35 | */ 36 | + (CLLocationCoordinate2D)gcj02ToWgs84:(CLLocationCoordinate2D)location; 37 | 38 | 39 | /** 40 | * @brief 世界标准地理坐标(WGS-84) 转换成 百度地理坐标(BD-09) 41 | * 42 | * @param location 世界标准地理坐标(WGS-84) 43 | * 44 | * @return 百度地理坐标(BD-09) 45 | */ 46 | + (CLLocationCoordinate2D)wgs84ToBd09:(CLLocationCoordinate2D)location; 47 | 48 | 49 | /** 50 | * @brief 中国国测局地理坐标(GCJ-02)<火星坐标> 转换成 百度地理坐标(BD-09) 51 | * 52 | * @param location 中国国测局地理坐标(GCJ-02)<火星坐标> 53 | * 54 | * @return 百度地理坐标(BD-09) 55 | */ 56 | + (CLLocationCoordinate2D)gcj02ToBd09:(CLLocationCoordinate2D)location; 57 | 58 | 59 | /** 60 | * @brief 百度地理坐标(BD-09) 转换成 中国国测局地理坐标(GCJ-02)<火星坐标> 61 | * 62 | * @param location 百度地理坐标(BD-09) 63 | * 64 | * @return 中国国测局地理坐标(GCJ-02)<火星坐标> 65 | */ 66 | + (CLLocationCoordinate2D)bd09ToGcj02:(CLLocationCoordinate2D)location; 67 | 68 | 69 | /** 70 | * @brief 百度地理坐标(BD-09) 转换成 世界标准地理坐标(WGS-84) 71 | * 72 | * ####此接口有1-2米左右的误差,需要精确定位情景慎用 73 | * 74 | * @param location 百度地理坐标(BD-09) 75 | * 76 | * @return 世界标准地理坐标(WGS-84) 77 | */ 78 | + (CLLocationCoordinate2D)bd09ToWgs84:(CLLocationCoordinate2D)location; 79 | @end 80 | -------------------------------------------------------------------------------- /simulatorLocation/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /simulatorLocation.xcodeproj/xcuserdata/zhang.xcuserdatad/xcschemes/simulatorLocation.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /simulatorLocation/MSManageLocation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MSManageLocation.m 3 | // simulatorLocation 4 | // 5 | // Created by zhang on 2017/4/14. 6 | // Copyright © 2017年 zhang. All rights reserved. 7 | // 8 | 9 | #import "MSManageLocation.h" 10 | 11 | #import 12 | #define LAT_OFFSET_0(x,y) -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(fabs(x)) 13 | #define LAT_OFFSET_1 (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0 14 | #define LAT_OFFSET_2 (20.0 * sin(y * M_PI) + 40.0 * sin(y / 3.0 * M_PI)) * 2.0 / 3.0 15 | #define LAT_OFFSET_3 (160.0 * sin(y / 12.0 * M_PI) + 320 * sin(y * M_PI / 30.0)) * 2.0 / 3.0 16 | 17 | #define LON_OFFSET_0(x,y) 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(fabs(x)) 18 | #define LON_OFFSET_1 (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0 19 | #define LON_OFFSET_2 (20.0 * sin(x * M_PI) + 40.0 * sin(x / 3.0 * M_PI)) * 2.0 / 3.0 20 | #define LON_OFFSET_3 (150.0 * sin(x / 12.0 * M_PI) + 300.0 * sin(x / 30.0 * M_PI)) * 2.0 / 3.0 21 | 22 | #define RANGE_LON_MAX 137.8347 23 | #define RANGE_LON_MIN 72.004 24 | #define RANGE_LAT_MAX 55.8271 25 | #define RANGE_LAT_MIN 0.8293 26 | // jzA = 6378245.0, 1/f = 298.3 27 | // b = a * (1 - f) 28 | // ee = (a^2 - b^2) / a^2; 29 | #define jzA 6378245.0 30 | #define jzEE 0.00669342162296594323 31 | 32 | @implementation MSManageLocation 33 | + (double)transformLat:(double)x bdLon:(double)y 34 | { 35 | double ret = LAT_OFFSET_0(x, y); 36 | ret += LAT_OFFSET_1; 37 | ret += LAT_OFFSET_2; 38 | ret += LAT_OFFSET_3; 39 | return ret; 40 | } 41 | 42 | + (double)transformLon:(double)x bdLon:(double)y 43 | { 44 | double ret = LON_OFFSET_0(x, y); 45 | ret += LON_OFFSET_1; 46 | ret += LON_OFFSET_2; 47 | ret += LON_OFFSET_3; 48 | return ret; 49 | } 50 | 51 | + (BOOL)outOfChina:(double)lat bdLon:(double)lon 52 | { 53 | if (lon < RANGE_LON_MIN || lon > RANGE_LON_MAX) 54 | return true; 55 | if (lat < RANGE_LAT_MIN || lat > RANGE_LAT_MAX) 56 | return true; 57 | return false; 58 | } 59 | 60 | + (CLLocationCoordinate2D)gcj02Encrypt:(double)ggLat bdLon:(double)ggLon 61 | { 62 | CLLocationCoordinate2D resPoint; 63 | double mgLat; 64 | double mgLon; 65 | if ([self outOfChina:ggLat bdLon:ggLon]) { 66 | resPoint.latitude = ggLat; 67 | resPoint.longitude = ggLon; 68 | return resPoint; 69 | } 70 | double dLat = [self transformLat:(ggLon - 105.0)bdLon:(ggLat - 35.0)]; 71 | double dLon = [self transformLon:(ggLon - 105.0) bdLon:(ggLat - 35.0)]; 72 | double radLat = ggLat / 180.0 * M_PI; 73 | double magic = sin(radLat); 74 | magic = 1 - jzEE * magic * magic; 75 | double sqrtMagic = sqrt(magic); 76 | dLat = (dLat * 180.0) / ((jzA * (1 - jzEE)) / (magic * sqrtMagic) * M_PI); 77 | dLon = (dLon * 180.0) / (jzA / sqrtMagic * cos(radLat) * M_PI); 78 | mgLat = ggLat + dLat; 79 | mgLon = ggLon + dLon; 80 | 81 | resPoint.latitude = mgLat; 82 | resPoint.longitude = mgLon; 83 | return resPoint; 84 | } 85 | 86 | + (CLLocationCoordinate2D)gcj02Decrypt:(double)gjLat gjLon:(double)gjLon { 87 | CLLocationCoordinate2D gPt = [self gcj02Encrypt:gjLat bdLon:gjLon]; 88 | double dLon = gPt.longitude - gjLon; 89 | double dLat = gPt.latitude - gjLat; 90 | CLLocationCoordinate2D pt; 91 | pt.latitude = gjLat - dLat; 92 | pt.longitude = gjLon - dLon; 93 | return pt; 94 | } 95 | 96 | + (CLLocationCoordinate2D)bd09Decrypt:(double)bdLat bdLon:(double)bdLon 97 | { 98 | CLLocationCoordinate2D gcjPt; 99 | double x = bdLon - 0.0065, y = bdLat - 0.006; 100 | double z = sqrt(x * x + y * y) - 0.00002 * sin(y * M_PI); 101 | double theta = atan2(y, x) - 0.000003 * cos(x * M_PI); 102 | gcjPt.longitude = z * cos(theta); 103 | gcjPt.latitude = z * sin(theta); 104 | return gcjPt; 105 | } 106 | 107 | +(CLLocationCoordinate2D)bd09Encrypt:(double)ggLat bdLon:(double)ggLon 108 | { 109 | CLLocationCoordinate2D bdPt; 110 | double x = ggLon, y = ggLat; 111 | double z = sqrt(x * x + y * y) + 0.00002 * sin(y * M_PI); 112 | double theta = atan2(y, x) + 0.000003 * cos(x * M_PI); 113 | bdPt.longitude = z * cos(theta) + 0.0065; 114 | bdPt.latitude = z * sin(theta) + 0.006; 115 | return bdPt; 116 | } 117 | 118 | 119 | + (CLLocationCoordinate2D)wgs84ToGcj02:(CLLocationCoordinate2D)location 120 | { 121 | return [self gcj02Encrypt:location.latitude bdLon:location.longitude]; 122 | } 123 | 124 | + (CLLocationCoordinate2D)gcj02ToWgs84:(CLLocationCoordinate2D)location 125 | { 126 | return [self gcj02Decrypt:location.latitude gjLon:location.longitude]; 127 | } 128 | 129 | 130 | + (CLLocationCoordinate2D)wgs84ToBd09:(CLLocationCoordinate2D)location 131 | { 132 | CLLocationCoordinate2D gcj02Pt = [self gcj02Encrypt:location.latitude 133 | bdLon:location.longitude]; 134 | return [self bd09Encrypt:gcj02Pt.latitude bdLon:gcj02Pt.longitude] ; 135 | } 136 | 137 | + (CLLocationCoordinate2D)gcj02ToBd09:(CLLocationCoordinate2D)location 138 | { 139 | return [self bd09Encrypt:location.latitude bdLon:location.longitude]; 140 | } 141 | 142 | + (CLLocationCoordinate2D)bd09ToGcj02:(CLLocationCoordinate2D)location 143 | { 144 | return [self bd09Decrypt:location.latitude bdLon:location.longitude]; 145 | } 146 | 147 | + (CLLocationCoordinate2D)bd09ToWgs84:(CLLocationCoordinate2D)location 148 | { 149 | CLLocationCoordinate2D gcj02 = [self bd09ToGcj02:location]; 150 | return [self gcj02Decrypt:gcj02.latitude gjLon:gcj02.longitude]; 151 | } 152 | @end 153 | -------------------------------------------------------------------------------- /simulatorLocation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1F67A8901EA075E9001698AA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F67A88F1EA075E9001698AA /* main.m */; }; 11 | 1F67A8931EA075E9001698AA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F67A8921EA075E9001698AA /* AppDelegate.m */; }; 12 | 1F67A8961EA075E9001698AA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F67A8951EA075E9001698AA /* ViewController.m */; }; 13 | 1F67A8991EA075E9001698AA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1F67A8971EA075E9001698AA /* Main.storyboard */; }; 14 | 1F67A89B1EA075E9001698AA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1F67A89A1EA075E9001698AA /* Assets.xcassets */; }; 15 | 1F67A89E1EA075E9001698AA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1F67A89C1EA075E9001698AA /* LaunchScreen.storyboard */; }; 16 | 1F67A8A91EA075E9001698AA /* simulatorLocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F67A8A81EA075E9001698AA /* simulatorLocationTests.m */; }; 17 | 1F67A8B41EA075E9001698AA /* simulatorLocationUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F67A8B31EA075E9001698AA /* simulatorLocationUITests.m */; }; 18 | 1F67A8C31EA07630001698AA /* MSManageLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F67A8C21EA07630001698AA /* MSManageLocation.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 1F67A8A51EA075E9001698AA /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 1F67A8831EA075E9001698AA /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 1F67A88A1EA075E9001698AA; 27 | remoteInfo = simulatorLocation; 28 | }; 29 | 1F67A8B01EA075E9001698AA /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 1F67A8831EA075E9001698AA /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 1F67A88A1EA075E9001698AA; 34 | remoteInfo = simulatorLocation; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1F67A88B1EA075E9001698AA /* simulatorLocation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = simulatorLocation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 1F67A88F1EA075E9001698AA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 1F67A8911EA075E9001698AA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 1F67A8921EA075E9001698AA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 1F67A8941EA075E9001698AA /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 1F67A8951EA075E9001698AA /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 1F67A8981EA075E9001698AA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 1F67A89A1EA075E9001698AA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 1F67A89D1EA075E9001698AA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 1F67A89F1EA075E9001698AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 1F67A8A41EA075E9001698AA /* simulatorLocationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = simulatorLocationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 1F67A8A81EA075E9001698AA /* simulatorLocationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = simulatorLocationTests.m; sourceTree = ""; }; 51 | 1F67A8AA1EA075E9001698AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 1F67A8AF1EA075E9001698AA /* simulatorLocationUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = simulatorLocationUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 1F67A8B31EA075E9001698AA /* simulatorLocationUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = simulatorLocationUITests.m; sourceTree = ""; }; 54 | 1F67A8B51EA075E9001698AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 1F67A8C11EA07630001698AA /* MSManageLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSManageLocation.h; sourceTree = ""; }; 56 | 1F67A8C21EA07630001698AA /* MSManageLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSManageLocation.m; sourceTree = ""; }; 57 | 1F67A8C41EA07724001698AA /* Location.gpx */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Location.gpx; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 1F67A8881EA075E9001698AA /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 1F67A8A11EA075E9001698AA /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 1F67A8AC1EA075E9001698AA /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 1F67A8821EA075E9001698AA = { 86 | isa = PBXGroup; 87 | children = ( 88 | 1F67A88D1EA075E9001698AA /* simulatorLocation */, 89 | 1F67A8A71EA075E9001698AA /* simulatorLocationTests */, 90 | 1F67A8B21EA075E9001698AA /* simulatorLocationUITests */, 91 | 1F67A88C1EA075E9001698AA /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | 1F67A88C1EA075E9001698AA /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 1F67A88B1EA075E9001698AA /* simulatorLocation.app */, 99 | 1F67A8A41EA075E9001698AA /* simulatorLocationTests.xctest */, 100 | 1F67A8AF1EA075E9001698AA /* simulatorLocationUITests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 1F67A88D1EA075E9001698AA /* simulatorLocation */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 1F67A8911EA075E9001698AA /* AppDelegate.h */, 109 | 1F67A8921EA075E9001698AA /* AppDelegate.m */, 110 | 1F67A8941EA075E9001698AA /* ViewController.h */, 111 | 1F67A8951EA075E9001698AA /* ViewController.m */, 112 | 1F67A8C11EA07630001698AA /* MSManageLocation.h */, 113 | 1F67A8C21EA07630001698AA /* MSManageLocation.m */, 114 | 1F67A8971EA075E9001698AA /* Main.storyboard */, 115 | 1F67A89A1EA075E9001698AA /* Assets.xcassets */, 116 | 1F67A89C1EA075E9001698AA /* LaunchScreen.storyboard */, 117 | 1F67A89F1EA075E9001698AA /* Info.plist */, 118 | 1F67A88E1EA075E9001698AA /* Supporting Files */, 119 | 1F67A8C41EA07724001698AA /* Location.gpx */, 120 | ); 121 | path = simulatorLocation; 122 | sourceTree = ""; 123 | }; 124 | 1F67A88E1EA075E9001698AA /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 1F67A88F1EA075E9001698AA /* main.m */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 1F67A8A71EA075E9001698AA /* simulatorLocationTests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 1F67A8A81EA075E9001698AA /* simulatorLocationTests.m */, 136 | 1F67A8AA1EA075E9001698AA /* Info.plist */, 137 | ); 138 | path = simulatorLocationTests; 139 | sourceTree = ""; 140 | }; 141 | 1F67A8B21EA075E9001698AA /* simulatorLocationUITests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 1F67A8B31EA075E9001698AA /* simulatorLocationUITests.m */, 145 | 1F67A8B51EA075E9001698AA /* Info.plist */, 146 | ); 147 | path = simulatorLocationUITests; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 1F67A88A1EA075E9001698AA /* simulatorLocation */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 1F67A8B81EA075E9001698AA /* Build configuration list for PBXNativeTarget "simulatorLocation" */; 156 | buildPhases = ( 157 | 1F67A8871EA075E9001698AA /* Sources */, 158 | 1F67A8881EA075E9001698AA /* Frameworks */, 159 | 1F67A8891EA075E9001698AA /* Resources */, 160 | ); 161 | buildRules = ( 162 | ); 163 | dependencies = ( 164 | ); 165 | name = simulatorLocation; 166 | productName = simulatorLocation; 167 | productReference = 1F67A88B1EA075E9001698AA /* simulatorLocation.app */; 168 | productType = "com.apple.product-type.application"; 169 | }; 170 | 1F67A8A31EA075E9001698AA /* simulatorLocationTests */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = 1F67A8BB1EA075E9001698AA /* Build configuration list for PBXNativeTarget "simulatorLocationTests" */; 173 | buildPhases = ( 174 | 1F67A8A01EA075E9001698AA /* Sources */, 175 | 1F67A8A11EA075E9001698AA /* Frameworks */, 176 | 1F67A8A21EA075E9001698AA /* Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | 1F67A8A61EA075E9001698AA /* PBXTargetDependency */, 182 | ); 183 | name = simulatorLocationTests; 184 | productName = simulatorLocationTests; 185 | productReference = 1F67A8A41EA075E9001698AA /* simulatorLocationTests.xctest */; 186 | productType = "com.apple.product-type.bundle.unit-test"; 187 | }; 188 | 1F67A8AE1EA075E9001698AA /* simulatorLocationUITests */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = 1F67A8BE1EA075E9001698AA /* Build configuration list for PBXNativeTarget "simulatorLocationUITests" */; 191 | buildPhases = ( 192 | 1F67A8AB1EA075E9001698AA /* Sources */, 193 | 1F67A8AC1EA075E9001698AA /* Frameworks */, 194 | 1F67A8AD1EA075E9001698AA /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | 1F67A8B11EA075E9001698AA /* PBXTargetDependency */, 200 | ); 201 | name = simulatorLocationUITests; 202 | productName = simulatorLocationUITests; 203 | productReference = 1F67A8AF1EA075E9001698AA /* simulatorLocationUITests.xctest */; 204 | productType = "com.apple.product-type.bundle.ui-testing"; 205 | }; 206 | /* End PBXNativeTarget section */ 207 | 208 | /* Begin PBXProject section */ 209 | 1F67A8831EA075E9001698AA /* Project object */ = { 210 | isa = PBXProject; 211 | attributes = { 212 | LastUpgradeCheck = 0830; 213 | ORGANIZATIONNAME = zhang; 214 | TargetAttributes = { 215 | 1F67A88A1EA075E9001698AA = { 216 | CreatedOnToolsVersion = 8.3; 217 | DevelopmentTeam = M3X6V6RQ25; 218 | ProvisioningStyle = Automatic; 219 | }; 220 | 1F67A8A31EA075E9001698AA = { 221 | CreatedOnToolsVersion = 8.3; 222 | ProvisioningStyle = Automatic; 223 | TestTargetID = 1F67A88A1EA075E9001698AA; 224 | }; 225 | 1F67A8AE1EA075E9001698AA = { 226 | CreatedOnToolsVersion = 8.3; 227 | ProvisioningStyle = Automatic; 228 | TestTargetID = 1F67A88A1EA075E9001698AA; 229 | }; 230 | }; 231 | }; 232 | buildConfigurationList = 1F67A8861EA075E9001698AA /* Build configuration list for PBXProject "simulatorLocation" */; 233 | compatibilityVersion = "Xcode 3.2"; 234 | developmentRegion = English; 235 | hasScannedForEncodings = 0; 236 | knownRegions = ( 237 | en, 238 | Base, 239 | ); 240 | mainGroup = 1F67A8821EA075E9001698AA; 241 | productRefGroup = 1F67A88C1EA075E9001698AA /* Products */; 242 | projectDirPath = ""; 243 | projectRoot = ""; 244 | targets = ( 245 | 1F67A88A1EA075E9001698AA /* simulatorLocation */, 246 | 1F67A8A31EA075E9001698AA /* simulatorLocationTests */, 247 | 1F67A8AE1EA075E9001698AA /* simulatorLocationUITests */, 248 | ); 249 | }; 250 | /* End PBXProject section */ 251 | 252 | /* Begin PBXResourcesBuildPhase section */ 253 | 1F67A8891EA075E9001698AA /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 1F67A89E1EA075E9001698AA /* LaunchScreen.storyboard in Resources */, 258 | 1F67A89B1EA075E9001698AA /* Assets.xcassets in Resources */, 259 | 1F67A8991EA075E9001698AA /* Main.storyboard in Resources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | 1F67A8A21EA075E9001698AA /* Resources */ = { 264 | isa = PBXResourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | 1F67A8AD1EA075E9001698AA /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | /* End PBXResourcesBuildPhase section */ 278 | 279 | /* Begin PBXSourcesBuildPhase section */ 280 | 1F67A8871EA075E9001698AA /* Sources */ = { 281 | isa = PBXSourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 1F67A8961EA075E9001698AA /* ViewController.m in Sources */, 285 | 1F67A8931EA075E9001698AA /* AppDelegate.m in Sources */, 286 | 1F67A8901EA075E9001698AA /* main.m in Sources */, 287 | 1F67A8C31EA07630001698AA /* MSManageLocation.m in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | 1F67A8A01EA075E9001698AA /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 1F67A8A91EA075E9001698AA /* simulatorLocationTests.m in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | 1F67A8AB1EA075E9001698AA /* Sources */ = { 300 | isa = PBXSourcesBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | 1F67A8B41EA075E9001698AA /* simulatorLocationUITests.m in Sources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | /* End PBXSourcesBuildPhase section */ 308 | 309 | /* Begin PBXTargetDependency section */ 310 | 1F67A8A61EA075E9001698AA /* PBXTargetDependency */ = { 311 | isa = PBXTargetDependency; 312 | target = 1F67A88A1EA075E9001698AA /* simulatorLocation */; 313 | targetProxy = 1F67A8A51EA075E9001698AA /* PBXContainerItemProxy */; 314 | }; 315 | 1F67A8B11EA075E9001698AA /* PBXTargetDependency */ = { 316 | isa = PBXTargetDependency; 317 | target = 1F67A88A1EA075E9001698AA /* simulatorLocation */; 318 | targetProxy = 1F67A8B01EA075E9001698AA /* PBXContainerItemProxy */; 319 | }; 320 | /* End PBXTargetDependency section */ 321 | 322 | /* Begin PBXVariantGroup section */ 323 | 1F67A8971EA075E9001698AA /* Main.storyboard */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | 1F67A8981EA075E9001698AA /* Base */, 327 | ); 328 | name = Main.storyboard; 329 | sourceTree = ""; 330 | }; 331 | 1F67A89C1EA075E9001698AA /* LaunchScreen.storyboard */ = { 332 | isa = PBXVariantGroup; 333 | children = ( 334 | 1F67A89D1EA075E9001698AA /* Base */, 335 | ); 336 | name = LaunchScreen.storyboard; 337 | sourceTree = ""; 338 | }; 339 | /* End PBXVariantGroup section */ 340 | 341 | /* Begin XCBuildConfiguration section */ 342 | 1F67A8B61EA075E9001698AA /* Debug */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_ANALYZER_NONNULL = YES; 347 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 348 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 349 | CLANG_CXX_LIBRARY = "libc++"; 350 | CLANG_ENABLE_MODULES = YES; 351 | CLANG_ENABLE_OBJC_ARC = YES; 352 | CLANG_WARN_BOOL_CONVERSION = YES; 353 | CLANG_WARN_CONSTANT_CONVERSION = YES; 354 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 355 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INFINITE_RECURSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 362 | CLANG_WARN_UNREACHABLE_CODE = YES; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = NO; 366 | DEBUG_INFORMATION_FORMAT = dwarf; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | ENABLE_TESTABILITY = YES; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_DYNAMIC_NO_PIC = NO; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_OPTIMIZATION_LEVEL = 0; 373 | GCC_PREPROCESSOR_DEFINITIONS = ( 374 | "DEBUG=1", 375 | "$(inherited)", 376 | ); 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 384 | MTL_ENABLE_DEBUG_INFO = YES; 385 | ONLY_ACTIVE_ARCH = YES; 386 | SDKROOT = iphoneos; 387 | }; 388 | name = Debug; 389 | }; 390 | 1F67A8B71EA075E9001698AA /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | CLANG_ANALYZER_NONNULL = YES; 395 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BOOL_CONVERSION = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 403 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INFINITE_RECURSION = YES; 407 | CLANG_WARN_INT_CONVERSION = YES; 408 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 409 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 410 | CLANG_WARN_UNREACHABLE_CODE = YES; 411 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 412 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 413 | COPY_PHASE_STRIP = NO; 414 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 415 | ENABLE_NS_ASSERTIONS = NO; 416 | ENABLE_STRICT_OBJC_MSGSEND = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 426 | MTL_ENABLE_DEBUG_INFO = NO; 427 | SDKROOT = iphoneos; 428 | VALIDATE_PRODUCT = YES; 429 | }; 430 | name = Release; 431 | }; 432 | 1F67A8B91EA075E9001698AA /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 436 | DEVELOPMENT_TEAM = M3X6V6RQ25; 437 | INFOPLIST_FILE = simulatorLocation/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 439 | PRODUCT_BUNDLE_IDENTIFIER = "----.simulatorLocation"; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | }; 442 | name = Debug; 443 | }; 444 | 1F67A8BA1EA075E9001698AA /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | DEVELOPMENT_TEAM = M3X6V6RQ25; 449 | INFOPLIST_FILE = simulatorLocation/Info.plist; 450 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 451 | PRODUCT_BUNDLE_IDENTIFIER = "----.simulatorLocation"; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | }; 454 | name = Release; 455 | }; 456 | 1F67A8BC1EA075E9001698AA /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | BUNDLE_LOADER = "$(TEST_HOST)"; 460 | INFOPLIST_FILE = simulatorLocationTests/Info.plist; 461 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 462 | PRODUCT_BUNDLE_IDENTIFIER = "----.simulatorLocationTests"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/simulatorLocation.app/simulatorLocation"; 465 | }; 466 | name = Debug; 467 | }; 468 | 1F67A8BD1EA075E9001698AA /* Release */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | BUNDLE_LOADER = "$(TEST_HOST)"; 472 | INFOPLIST_FILE = simulatorLocationTests/Info.plist; 473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 474 | PRODUCT_BUNDLE_IDENTIFIER = "----.simulatorLocationTests"; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/simulatorLocation.app/simulatorLocation"; 477 | }; 478 | name = Release; 479 | }; 480 | 1F67A8BF1EA075E9001698AA /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | buildSettings = { 483 | INFOPLIST_FILE = simulatorLocationUITests/Info.plist; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 485 | PRODUCT_BUNDLE_IDENTIFIER = "----.simulatorLocationUITests"; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | TEST_TARGET_NAME = simulatorLocation; 488 | }; 489 | name = Debug; 490 | }; 491 | 1F67A8C01EA075E9001698AA /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | INFOPLIST_FILE = simulatorLocationUITests/Info.plist; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 496 | PRODUCT_BUNDLE_IDENTIFIER = "----.simulatorLocationUITests"; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | TEST_TARGET_NAME = simulatorLocation; 499 | }; 500 | name = Release; 501 | }; 502 | /* End XCBuildConfiguration section */ 503 | 504 | /* Begin XCConfigurationList section */ 505 | 1F67A8861EA075E9001698AA /* Build configuration list for PBXProject "simulatorLocation" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 1F67A8B61EA075E9001698AA /* Debug */, 509 | 1F67A8B71EA075E9001698AA /* Release */, 510 | ); 511 | defaultConfigurationIsVisible = 0; 512 | defaultConfigurationName = Release; 513 | }; 514 | 1F67A8B81EA075E9001698AA /* Build configuration list for PBXNativeTarget "simulatorLocation" */ = { 515 | isa = XCConfigurationList; 516 | buildConfigurations = ( 517 | 1F67A8B91EA075E9001698AA /* Debug */, 518 | 1F67A8BA1EA075E9001698AA /* Release */, 519 | ); 520 | defaultConfigurationIsVisible = 0; 521 | }; 522 | 1F67A8BB1EA075E9001698AA /* Build configuration list for PBXNativeTarget "simulatorLocationTests" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 1F67A8BC1EA075E9001698AA /* Debug */, 526 | 1F67A8BD1EA075E9001698AA /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | }; 530 | 1F67A8BE1EA075E9001698AA /* Build configuration list for PBXNativeTarget "simulatorLocationUITests" */ = { 531 | isa = XCConfigurationList; 532 | buildConfigurations = ( 533 | 1F67A8BF1EA075E9001698AA /* Debug */, 534 | 1F67A8C01EA075E9001698AA /* Release */, 535 | ); 536 | defaultConfigurationIsVisible = 0; 537 | }; 538 | /* End XCConfigurationList section */ 539 | }; 540 | rootObject = 1F67A8831EA075E9001698AA /* Project object */; 541 | } 542 | --------------------------------------------------------------------------------