├── CGLTestApp-Info.plist ├── CoreGeoLocation.xcodeproj └── project.pbxproj ├── CoreGeoLocation_Prefix.pch ├── English.lproj └── InfoPlist.strings ├── Info.plist ├── README ├── README.markdown ├── Resources └── Test App │ └── MainMenu.xib └── Source ├── Additions ├── NSString+CGLURLLoadingAdditions.h └── NSString+CGLURLLoadingAdditions.m ├── CGLGeoDataProvider.h ├── CGLGeoDataProvider.m ├── CGLGeoDataProviderGoogle.h ├── CGLGeoDataProviderGoogle.m ├── CGLGeoDataProviderYahoo.h ├── CGLGeoDataProviderYahoo.m ├── CGLGeoLocation.h ├── CGLGeoLocation.m ├── CGLGeoManager.h ├── CGLGeoManager.m ├── CGLGeoRequest.h ├── CGLGeoRequest.m ├── CGLURLRequestLoader.h ├── CGLURLRequestLoader.m ├── CoreGeoLocation.h ├── NSURLResponse+CGLEncodingAdditions.h ├── NSURLResponse+CGLEncodingAdditions.m ├── Test App ├── CGLTestAppController.h ├── CGLTestAppController.m └── main.m └── Utilities ├── CGLXML.h └── CGLXML.m /CGLTestApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.matrixPointer.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | LSMinimumSystemVersion 22 | ${MACOSX_DEPLOYMENT_TARGET} 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /CoreGeoLocation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | CB9DBB20105C51A600EA2DF5 /* Build All */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = CB9DBB59105C520C00EA2DF5 /* Build configuration list for PBXAggregateTarget "Build All" */; 13 | buildPhases = ( 14 | ); 15 | dependencies = ( 16 | CB911704105C6D4800EDA68B /* PBXTargetDependency */, 17 | CB9DBB24105C51AD00EA2DF5 /* PBXTargetDependency */, 18 | CB9DBB26105C51B100EA2DF5 /* PBXTargetDependency */, 19 | ); 20 | name = "Build All"; 21 | productName = "Build ALl"; 22 | }; 23 | /* End PBXAggregateTarget section */ 24 | 25 | /* Begin PBXBuildFile section */ 26 | 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 27 | 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; 28 | CB0C2FB210606E35006725A8 /* CGLGeoDataProviderGoogle.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0C2FB010606E35006725A8 /* CGLGeoDataProviderGoogle.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29 | CB0C2FB310606E35006725A8 /* CGLGeoDataProviderGoogle.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0C2FB110606E35006725A8 /* CGLGeoDataProviderGoogle.m */; }; 30 | CB0C2FB410606E35006725A8 /* CGLGeoDataProviderGoogle.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0C2FB010606E35006725A8 /* CGLGeoDataProviderGoogle.h */; }; 31 | CB0C2FB510606E35006725A8 /* CGLGeoDataProviderGoogle.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0C2FB110606E35006725A8 /* CGLGeoDataProviderGoogle.m */; }; 32 | CB0C3009106075DA006725A8 /* CGLXML.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0C3007106075DA006725A8 /* CGLXML.h */; }; 33 | CB0C300A106075DA006725A8 /* CGLXML.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0C3008106075DA006725A8 /* CGLXML.m */; }; 34 | CB0C300B106075DA006725A8 /* CGLXML.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0C3007106075DA006725A8 /* CGLXML.h */; }; 35 | CB0C300C106075DA006725A8 /* CGLXML.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0C3008106075DA006725A8 /* CGLXML.m */; }; 36 | CB0C30661060825B006725A8 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB0C30651060825B006725A8 /* CoreLocation.framework */; }; 37 | CB9115F0105C556000EDA68B /* CGLGeoRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9115EE105C556000EDA68B /* CGLGeoRequest.h */; }; 38 | CB9115F1105C556000EDA68B /* CGLGeoRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9115EF105C556000EDA68B /* CGLGeoRequest.m */; }; 39 | CB9115F2105C556000EDA68B /* CGLGeoRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9115EE105C556000EDA68B /* CGLGeoRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 40 | CB9115F3105C556000EDA68B /* CGLGeoRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9115EF105C556000EDA68B /* CGLGeoRequest.m */; }; 41 | CB91163E105C596700EDA68B /* CGLGeoDataProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = CB91163C105C596700EDA68B /* CGLGeoDataProvider.h */; }; 42 | CB91163F105C596700EDA68B /* CGLGeoDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = CB91163D105C596700EDA68B /* CGLGeoDataProvider.m */; }; 43 | CB911640105C596700EDA68B /* CGLGeoDataProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = CB91163C105C596700EDA68B /* CGLGeoDataProvider.h */; settings = {ATTRIBUTES = (Public, ); }; }; 44 | CB911641105C596700EDA68B /* CGLGeoDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = CB91163D105C596700EDA68B /* CGLGeoDataProvider.m */; }; 45 | CB911644105C59D400EDA68B /* CGLGeoDataProviderYahoo.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911642105C59D400EDA68B /* CGLGeoDataProviderYahoo.h */; }; 46 | CB911645105C59D400EDA68B /* CGLGeoDataProviderYahoo.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911643105C59D400EDA68B /* CGLGeoDataProviderYahoo.m */; }; 47 | CB911646105C59D400EDA68B /* CGLGeoDataProviderYahoo.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911642105C59D400EDA68B /* CGLGeoDataProviderYahoo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 48 | CB911647105C59D400EDA68B /* CGLGeoDataProviderYahoo.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911643105C59D400EDA68B /* CGLGeoDataProviderYahoo.m */; }; 49 | CB91167B105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911679105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h */; }; 50 | CB91167C105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CB91167A105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m */; }; 51 | CB91167D105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911679105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h */; }; 52 | CB91167E105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CB91167A105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m */; }; 53 | CB911681105C5EAD00EDA68B /* CGLURLRequestLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = CB91167F105C5EAD00EDA68B /* CGLURLRequestLoader.h */; }; 54 | CB911682105C5EAD00EDA68B /* CGLURLRequestLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911680105C5EAD00EDA68B /* CGLURLRequestLoader.m */; }; 55 | CB911683105C5EAD00EDA68B /* CGLURLRequestLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = CB91167F105C5EAD00EDA68B /* CGLURLRequestLoader.h */; }; 56 | CB911684105C5EAD00EDA68B /* CGLURLRequestLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911680105C5EAD00EDA68B /* CGLURLRequestLoader.m */; }; 57 | CB911697105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911695105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h */; }; 58 | CB911698105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911696105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m */; }; 59 | CB911699105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911695105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h */; }; 60 | CB91169A105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911696105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m */; }; 61 | CB9116F5105C6AF500EDA68B /* CGLTestAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9116F4105C6AF500EDA68B /* CGLTestAppController.m */; }; 62 | CB9116F7105C6B6100EDA68B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB9116F6105C6B6100EDA68B /* MainMenu.xib */; }; 63 | CB911708105C6D7E00EDA68B /* CoreGeoLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = CB911707105C6D7E00EDA68B /* CoreGeoLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 64 | CB91170C105C6E0C00EDA68B /* CoreGeoLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* CoreGeoLocation.framework */; }; 65 | CB911716105C6E7900EDA68B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB911715105C6E7900EDA68B /* main.m */; }; 66 | CB911871105C955000EDA68B /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CB911870105C955000EDA68B /* libxml2.dylib */; }; 67 | CB911874105C95AD00EDA68B /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CB911870105C955000EDA68B /* libxml2.dylib */; }; 68 | CB9DBB0F105C514900EA2DF5 /* CGLGeoManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9DBB0D105C514900EA2DF5 /* CGLGeoManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; 69 | CB9DBB10105C514900EA2DF5 /* CGLGeoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9DBB0E105C514900EA2DF5 /* CGLGeoManager.m */; }; 70 | CB9DBB11105C514900EA2DF5 /* CGLGeoManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9DBB0D105C514900EA2DF5 /* CGLGeoManager.h */; }; 71 | CB9DBB12105C514900EA2DF5 /* CGLGeoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9DBB0E105C514900EA2DF5 /* CGLGeoManager.m */; }; 72 | CB9DBB19105C518200EA2DF5 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB9DBB18105C518200EA2DF5 /* CoreLocation.framework */; }; 73 | CB9DBB68105C540900EA2DF5 /* CGLGeoLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9DBB66105C540900EA2DF5 /* CGLGeoLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 74 | CB9DBB69105C540900EA2DF5 /* CGLGeoLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9DBB67105C540900EA2DF5 /* CGLGeoLocation.m */; }; 75 | CB9DBB6A105C540900EA2DF5 /* CGLGeoLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9DBB66105C540900EA2DF5 /* CGLGeoLocation.h */; }; 76 | CB9DBB6B105C540900EA2DF5 /* CGLGeoLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9DBB67105C540900EA2DF5 /* CGLGeoLocation.m */; }; 77 | /* End PBXBuildFile section */ 78 | 79 | /* Begin PBXContainerItemProxy section */ 80 | CB911703105C6D4800EDA68B /* PBXContainerItemProxy */ = { 81 | isa = PBXContainerItemProxy; 82 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 83 | proxyType = 1; 84 | remoteGlobalIDString = CB9116D6105C6A8D00EDA68B; 85 | remoteInfo = CGLTestApp; 86 | }; 87 | CB911705105C6D5000EDA68B /* PBXContainerItemProxy */ = { 88 | isa = PBXContainerItemProxy; 89 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 90 | proxyType = 1; 91 | remoteGlobalIDString = 8DC2EF4F0486A6940098B216; 92 | remoteInfo = CoreGeoLocation; 93 | }; 94 | CB9DBB23105C51AD00EA2DF5 /* PBXContainerItemProxy */ = { 95 | isa = PBXContainerItemProxy; 96 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 97 | proxyType = 1; 98 | remoteGlobalIDString = 8DC2EF4F0486A6940098B216; 99 | remoteInfo = CoreGeoLocation; 100 | }; 101 | CB9DBB25105C51B100EA2DF5 /* PBXContainerItemProxy */ = { 102 | isa = PBXContainerItemProxy; 103 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 104 | proxyType = 1; 105 | remoteGlobalIDString = CB9DBB01105C50A500EA2DF5; 106 | remoteInfo = CoreGeoLocationMobile; 107 | }; 108 | /* End PBXContainerItemProxy section */ 109 | 110 | /* Begin PBXFileReference section */ 111 | 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 112 | 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 113 | 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 114 | 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 115 | 32DBCF5E0370ADEE00C91783 /* CoreGeoLocation_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoreGeoLocation_Prefix.pch; path = ../CoreGeoLocation_Prefix.pch; sourceTree = ""; }; 116 | 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 117 | 8DC2EF5B0486A6940098B216 /* CoreGeoLocation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreGeoLocation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 118 | CB0C2FB010606E35006725A8 /* CGLGeoDataProviderGoogle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLGeoDataProviderGoogle.h; sourceTree = ""; }; 119 | CB0C2FB110606E35006725A8 /* CGLGeoDataProviderGoogle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLGeoDataProviderGoogle.m; sourceTree = ""; }; 120 | CB0C3007106075DA006725A8 /* CGLXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLXML.h; sourceTree = ""; }; 121 | CB0C3008106075DA006725A8 /* CGLXML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLXML.m; sourceTree = ""; }; 122 | CB0C30651060825B006725A8 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 123 | CB9115EE105C556000EDA68B /* CGLGeoRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLGeoRequest.h; sourceTree = ""; }; 124 | CB9115EF105C556000EDA68B /* CGLGeoRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLGeoRequest.m; sourceTree = ""; }; 125 | CB91163C105C596700EDA68B /* CGLGeoDataProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLGeoDataProvider.h; sourceTree = ""; }; 126 | CB91163D105C596700EDA68B /* CGLGeoDataProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLGeoDataProvider.m; sourceTree = ""; }; 127 | CB911642105C59D400EDA68B /* CGLGeoDataProviderYahoo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLGeoDataProviderYahoo.h; sourceTree = ""; }; 128 | CB911643105C59D400EDA68B /* CGLGeoDataProviderYahoo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLGeoDataProviderYahoo.m; sourceTree = ""; }; 129 | CB911679105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+CGLURLLoadingAdditions.h"; path = "Additions/NSString+CGLURLLoadingAdditions.h"; sourceTree = ""; }; 130 | CB91167A105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+CGLURLLoadingAdditions.m"; path = "Additions/NSString+CGLURLLoadingAdditions.m"; sourceTree = ""; }; 131 | CB91167F105C5EAD00EDA68B /* CGLURLRequestLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLURLRequestLoader.h; sourceTree = ""; }; 132 | CB911680105C5EAD00EDA68B /* CGLURLRequestLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLURLRequestLoader.m; sourceTree = ""; }; 133 | CB911695105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURLResponse+CGLEncodingAdditions.h"; sourceTree = ""; }; 134 | CB911696105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURLResponse+CGLEncodingAdditions.m"; sourceTree = ""; }; 135 | CB9116D7105C6A8D00EDA68B /* CGLTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CGLTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 136 | CB9116D9105C6A8D00EDA68B /* CGLTestApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "CGLTestApp-Info.plist"; path = "../../CGLTestApp-Info.plist"; sourceTree = ""; }; 137 | CB9116F3105C6AF500EDA68B /* CGLTestAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLTestAppController.h; sourceTree = ""; }; 138 | CB9116F4105C6AF500EDA68B /* CGLTestAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLTestAppController.m; sourceTree = ""; }; 139 | CB9116F6105C6B6100EDA68B /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; 140 | CB911707105C6D7E00EDA68B /* CoreGeoLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGeoLocation.h; sourceTree = ""; }; 141 | CB911715105C6E7900EDA68B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 142 | CB91182B105C86F000EDA68B /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = ""; }; 143 | CB911870105C955000EDA68B /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; 144 | CB9DBB02105C50A500EA2DF5 /* libCoreGeoLocationMobile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCoreGeoLocationMobile.a; sourceTree = BUILT_PRODUCTS_DIR; }; 145 | CB9DBB0D105C514900EA2DF5 /* CGLGeoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLGeoManager.h; sourceTree = ""; }; 146 | CB9DBB0E105C514900EA2DF5 /* CGLGeoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLGeoManager.m; sourceTree = ""; }; 147 | CB9DBB18105C518200EA2DF5 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = /System/Library/Frameworks/CoreLocation.framework; sourceTree = ""; }; 148 | CB9DBB66105C540900EA2DF5 /* CGLGeoLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGLGeoLocation.h; sourceTree = ""; }; 149 | CB9DBB67105C540900EA2DF5 /* CGLGeoLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGLGeoLocation.m; sourceTree = ""; }; 150 | D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 151 | /* End PBXFileReference section */ 152 | 153 | /* Begin PBXFrameworksBuildPhase section */ 154 | 8DC2EF560486A6940098B216 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */, 159 | CB9DBB19105C518200EA2DF5 /* CoreLocation.framework in Frameworks */, 160 | CB911874105C95AD00EDA68B /* libxml2.dylib in Frameworks */, 161 | ); 162 | runOnlyForDeploymentPostprocessing = 0; 163 | }; 164 | CB9116D5105C6A8D00EDA68B /* Frameworks */ = { 165 | isa = PBXFrameworksBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | CB91170C105C6E0C00EDA68B /* CoreGeoLocation.framework in Frameworks */, 169 | CB0C30661060825B006725A8 /* CoreLocation.framework in Frameworks */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | CB9DBB00105C50A500EA2DF5 /* Frameworks */ = { 174 | isa = PBXFrameworksBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | CB911871105C955000EDA68B /* libxml2.dylib in Frameworks */, 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | }; 181 | /* End PBXFrameworksBuildPhase section */ 182 | 183 | /* Begin PBXGroup section */ 184 | 034768DFFF38A50411DB9C8B /* Products */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 8DC2EF5B0486A6940098B216 /* CoreGeoLocation.framework */, 188 | CB9DBB02105C50A500EA2DF5 /* libCoreGeoLocationMobile.a */, 189 | CB9116D7105C6A8D00EDA68B /* CGLTestApp.app */, 190 | ); 191 | name = Products; 192 | sourceTree = ""; 193 | }; 194 | 0867D691FE84028FC02AAC07 /* CoreGeoLocation */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 08FB77AEFE84172EC02AAC07 /* Source */, 198 | 089C1665FE841158C02AAC07 /* Resources */, 199 | 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 200 | CB9116DE105C6A9E00EDA68B /* Test App */, 201 | 034768DFFF38A50411DB9C8B /* Products */, 202 | CB911870105C955000EDA68B /* libxml2.dylib */, 203 | CB0C30651060825B006725A8 /* CoreLocation.framework */, 204 | ); 205 | name = CoreGeoLocation; 206 | sourceTree = ""; 207 | }; 208 | 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, 212 | 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, 213 | ); 214 | name = "External Frameworks and Libraries"; 215 | sourceTree = ""; 216 | }; 217 | 089C1665FE841158C02AAC07 /* Resources */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 8DC2EF5A0486A6940098B216 /* Info.plist */, 221 | 089C1666FE841158C02AAC07 /* InfoPlist.strings */, 222 | ); 223 | name = Resources; 224 | sourceTree = ""; 225 | }; 226 | 08FB77AEFE84172EC02AAC07 /* Source */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | CB911707105C6D7E00EDA68B /* CoreGeoLocation.h */, 230 | 32DBCF5E0370ADEE00C91783 /* CoreGeoLocation_Prefix.pch */, 231 | CB911678105C5CC900EDA68B /* Additions */, 232 | CB0C300D106075DF006725A8 /* Utilities */, 233 | CB9DBB0D105C514900EA2DF5 /* CGLGeoManager.h */, 234 | CB9DBB0E105C514900EA2DF5 /* CGLGeoManager.m */, 235 | CB9115EE105C556000EDA68B /* CGLGeoRequest.h */, 236 | CB9115EF105C556000EDA68B /* CGLGeoRequest.m */, 237 | CB9DBB66105C540900EA2DF5 /* CGLGeoLocation.h */, 238 | CB9DBB67105C540900EA2DF5 /* CGLGeoLocation.m */, 239 | CB91163C105C596700EDA68B /* CGLGeoDataProvider.h */, 240 | CB91163D105C596700EDA68B /* CGLGeoDataProvider.m */, 241 | CB911642105C59D400EDA68B /* CGLGeoDataProviderYahoo.h */, 242 | CB911643105C59D400EDA68B /* CGLGeoDataProviderYahoo.m */, 243 | CB0C2FB010606E35006725A8 /* CGLGeoDataProviderGoogle.h */, 244 | CB0C2FB110606E35006725A8 /* CGLGeoDataProviderGoogle.m */, 245 | CB91167F105C5EAD00EDA68B /* CGLURLRequestLoader.h */, 246 | CB911680105C5EAD00EDA68B /* CGLURLRequestLoader.m */, 247 | ); 248 | path = Source; 249 | sourceTree = ""; 250 | }; 251 | 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { 252 | isa = PBXGroup; 253 | children = ( 254 | 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, 255 | CB9DBB18105C518200EA2DF5 /* CoreLocation.framework */, 256 | ); 257 | name = "Linked Frameworks"; 258 | sourceTree = ""; 259 | }; 260 | 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { 261 | isa = PBXGroup; 262 | children = ( 263 | 0867D6A5FE840307C02AAC07 /* AppKit.framework */, 264 | D2F7E79907B2D74100F64583 /* CoreData.framework */, 265 | 0867D69BFE84028FC02AAC07 /* Foundation.framework */, 266 | CB91182B105C86F000EDA68B /* libxml2.dylib */, 267 | ); 268 | name = "Other Frameworks"; 269 | sourceTree = ""; 270 | }; 271 | CB0C300D106075DF006725A8 /* Utilities */ = { 272 | isa = PBXGroup; 273 | children = ( 274 | CB0C3007106075DA006725A8 /* CGLXML.h */, 275 | CB0C3008106075DA006725A8 /* CGLXML.m */, 276 | ); 277 | path = Utilities; 278 | sourceTree = ""; 279 | }; 280 | CB911678105C5CC900EDA68B /* Additions */ = { 281 | isa = PBXGroup; 282 | children = ( 283 | CB911679105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h */, 284 | CB91167A105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m */, 285 | CB911695105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h */, 286 | CB911696105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m */, 287 | ); 288 | name = Additions; 289 | sourceTree = ""; 290 | }; 291 | CB9116DE105C6A9E00EDA68B /* Test App */ = { 292 | isa = PBXGroup; 293 | children = ( 294 | CB9116F3105C6AF500EDA68B /* CGLTestAppController.h */, 295 | CB9116F4105C6AF500EDA68B /* CGLTestAppController.m */, 296 | CB911714105C6E6900EDA68B /* Other Sources */, 297 | CB9116D9105C6A8D00EDA68B /* CGLTestApp-Info.plist */, 298 | CB9116F8105C6B6900EDA68B /* Resources */, 299 | ); 300 | name = "Test App"; 301 | path = "Source/Test App"; 302 | sourceTree = ""; 303 | }; 304 | CB9116F8105C6B6900EDA68B /* Resources */ = { 305 | isa = PBXGroup; 306 | children = ( 307 | CB9116F6105C6B6100EDA68B /* MainMenu.xib */, 308 | ); 309 | name = Resources; 310 | path = "../../Resources/Test App"; 311 | sourceTree = ""; 312 | }; 313 | CB911714105C6E6900EDA68B /* Other Sources */ = { 314 | isa = PBXGroup; 315 | children = ( 316 | CB911715105C6E7900EDA68B /* main.m */, 317 | ); 318 | name = "Other Sources"; 319 | sourceTree = ""; 320 | }; 321 | /* End PBXGroup section */ 322 | 323 | /* Begin PBXHeadersBuildPhase section */ 324 | 8DC2EF500486A6940098B216 /* Headers */ = { 325 | isa = PBXHeadersBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | CB9DBB0F105C514900EA2DF5 /* CGLGeoManager.h in Headers */, 329 | CB9DBB68105C540900EA2DF5 /* CGLGeoLocation.h in Headers */, 330 | CB9115F2105C556000EDA68B /* CGLGeoRequest.h in Headers */, 331 | CB911640105C596700EDA68B /* CGLGeoDataProvider.h in Headers */, 332 | CB911646105C59D400EDA68B /* CGLGeoDataProviderYahoo.h in Headers */, 333 | CB91167D105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h in Headers */, 334 | CB911683105C5EAD00EDA68B /* CGLURLRequestLoader.h in Headers */, 335 | CB911699105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h in Headers */, 336 | CB911708105C6D7E00EDA68B /* CoreGeoLocation.h in Headers */, 337 | CB0C2FB210606E35006725A8 /* CGLGeoDataProviderGoogle.h in Headers */, 338 | CB0C3009106075DA006725A8 /* CGLXML.h in Headers */, 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | }; 342 | CB9DBAFE105C50A500EA2DF5 /* Headers */ = { 343 | isa = PBXHeadersBuildPhase; 344 | buildActionMask = 2147483647; 345 | files = ( 346 | CB9DBB11105C514900EA2DF5 /* CGLGeoManager.h in Headers */, 347 | CB9DBB6A105C540900EA2DF5 /* CGLGeoLocation.h in Headers */, 348 | CB9115F0105C556000EDA68B /* CGLGeoRequest.h in Headers */, 349 | CB91163E105C596700EDA68B /* CGLGeoDataProvider.h in Headers */, 350 | CB911644105C59D400EDA68B /* CGLGeoDataProviderYahoo.h in Headers */, 351 | CB91167B105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.h in Headers */, 352 | CB911681105C5EAD00EDA68B /* CGLURLRequestLoader.h in Headers */, 353 | CB911697105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.h in Headers */, 354 | CB0C2FB410606E35006725A8 /* CGLGeoDataProviderGoogle.h in Headers */, 355 | CB0C300B106075DA006725A8 /* CGLXML.h in Headers */, 356 | ); 357 | runOnlyForDeploymentPostprocessing = 0; 358 | }; 359 | /* End PBXHeadersBuildPhase section */ 360 | 361 | /* Begin PBXNativeTarget section */ 362 | 8DC2EF4F0486A6940098B216 /* CoreGeoLocation */ = { 363 | isa = PBXNativeTarget; 364 | buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CoreGeoLocation" */; 365 | buildPhases = ( 366 | 8DC2EF500486A6940098B216 /* Headers */, 367 | 8DC2EF520486A6940098B216 /* Resources */, 368 | 8DC2EF540486A6940098B216 /* Sources */, 369 | 8DC2EF560486A6940098B216 /* Frameworks */, 370 | ); 371 | buildRules = ( 372 | ); 373 | dependencies = ( 374 | ); 375 | name = CoreGeoLocation; 376 | productInstallPath = "$(HOME)/Library/Frameworks"; 377 | productName = CoreGeoLocation; 378 | productReference = 8DC2EF5B0486A6940098B216 /* CoreGeoLocation.framework */; 379 | productType = "com.apple.product-type.framework"; 380 | }; 381 | CB9116D6105C6A8D00EDA68B /* CGLTestApp */ = { 382 | isa = PBXNativeTarget; 383 | buildConfigurationList = CB9116DC105C6A8E00EDA68B /* Build configuration list for PBXNativeTarget "CGLTestApp" */; 384 | buildPhases = ( 385 | CB9116D3105C6A8D00EDA68B /* Resources */, 386 | CB9116D4105C6A8D00EDA68B /* Sources */, 387 | CB9116D5105C6A8D00EDA68B /* Frameworks */, 388 | ); 389 | buildRules = ( 390 | ); 391 | dependencies = ( 392 | CB911706105C6D5000EDA68B /* PBXTargetDependency */, 393 | ); 394 | name = CGLTestApp; 395 | productName = CGLTestApp; 396 | productReference = CB9116D7105C6A8D00EDA68B /* CGLTestApp.app */; 397 | productType = "com.apple.product-type.application"; 398 | }; 399 | CB9DBB01105C50A500EA2DF5 /* CoreGeoLocationMobile */ = { 400 | isa = PBXNativeTarget; 401 | buildConfigurationList = CB9DBB0A105C50D100EA2DF5 /* Build configuration list for PBXNativeTarget "CoreGeoLocationMobile" */; 402 | buildPhases = ( 403 | CB9DBAFE105C50A500EA2DF5 /* Headers */, 404 | CB9DBAFF105C50A500EA2DF5 /* Sources */, 405 | CB9DBB00105C50A500EA2DF5 /* Frameworks */, 406 | ); 407 | buildRules = ( 408 | ); 409 | dependencies = ( 410 | ); 411 | name = CoreGeoLocationMobile; 412 | productName = CoreGeoLocationMobile; 413 | productReference = CB9DBB02105C50A500EA2DF5 /* libCoreGeoLocationMobile.a */; 414 | productType = "com.apple.product-type.library.static"; 415 | }; 416 | /* End PBXNativeTarget section */ 417 | 418 | /* Begin PBXProject section */ 419 | 0867D690FE84028FC02AAC07 /* Project object */ = { 420 | isa = PBXProject; 421 | buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreGeoLocation" */; 422 | compatibilityVersion = "Xcode 3.1"; 423 | hasScannedForEncodings = 1; 424 | mainGroup = 0867D691FE84028FC02AAC07 /* CoreGeoLocation */; 425 | productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; 426 | projectDirPath = ""; 427 | projectRoot = ""; 428 | targets = ( 429 | CB9DBB20105C51A600EA2DF5 /* Build All */, 430 | CB9116D6105C6A8D00EDA68B /* CGLTestApp */, 431 | 8DC2EF4F0486A6940098B216 /* CoreGeoLocation */, 432 | CB9DBB01105C50A500EA2DF5 /* CoreGeoLocationMobile */, 433 | ); 434 | }; 435 | /* End PBXProject section */ 436 | 437 | /* Begin PBXResourcesBuildPhase section */ 438 | 8DC2EF520486A6940098B216 /* Resources */ = { 439 | isa = PBXResourcesBuildPhase; 440 | buildActionMask = 2147483647; 441 | files = ( 442 | 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */, 443 | ); 444 | runOnlyForDeploymentPostprocessing = 0; 445 | }; 446 | CB9116D3105C6A8D00EDA68B /* Resources */ = { 447 | isa = PBXResourcesBuildPhase; 448 | buildActionMask = 2147483647; 449 | files = ( 450 | CB9116F7105C6B6100EDA68B /* MainMenu.xib in Resources */, 451 | ); 452 | runOnlyForDeploymentPostprocessing = 0; 453 | }; 454 | /* End PBXResourcesBuildPhase section */ 455 | 456 | /* Begin PBXSourcesBuildPhase section */ 457 | 8DC2EF540486A6940098B216 /* Sources */ = { 458 | isa = PBXSourcesBuildPhase; 459 | buildActionMask = 2147483647; 460 | files = ( 461 | CB9DBB10105C514900EA2DF5 /* CGLGeoManager.m in Sources */, 462 | CB9DBB69105C540900EA2DF5 /* CGLGeoLocation.m in Sources */, 463 | CB9115F3105C556000EDA68B /* CGLGeoRequest.m in Sources */, 464 | CB911641105C596700EDA68B /* CGLGeoDataProvider.m in Sources */, 465 | CB911647105C59D400EDA68B /* CGLGeoDataProviderYahoo.m in Sources */, 466 | CB91167E105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m in Sources */, 467 | CB911684105C5EAD00EDA68B /* CGLURLRequestLoader.m in Sources */, 468 | CB91169A105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m in Sources */, 469 | CB0C2FB310606E35006725A8 /* CGLGeoDataProviderGoogle.m in Sources */, 470 | CB0C300A106075DA006725A8 /* CGLXML.m in Sources */, 471 | ); 472 | runOnlyForDeploymentPostprocessing = 0; 473 | }; 474 | CB9116D4105C6A8D00EDA68B /* Sources */ = { 475 | isa = PBXSourcesBuildPhase; 476 | buildActionMask = 2147483647; 477 | files = ( 478 | CB9116F5105C6AF500EDA68B /* CGLTestAppController.m in Sources */, 479 | CB911716105C6E7900EDA68B /* main.m in Sources */, 480 | ); 481 | runOnlyForDeploymentPostprocessing = 0; 482 | }; 483 | CB9DBAFF105C50A500EA2DF5 /* Sources */ = { 484 | isa = PBXSourcesBuildPhase; 485 | buildActionMask = 2147483647; 486 | files = ( 487 | CB9DBB12105C514900EA2DF5 /* CGLGeoManager.m in Sources */, 488 | CB9DBB6B105C540900EA2DF5 /* CGLGeoLocation.m in Sources */, 489 | CB9115F1105C556000EDA68B /* CGLGeoRequest.m in Sources */, 490 | CB91163F105C596700EDA68B /* CGLGeoDataProvider.m in Sources */, 491 | CB911645105C59D400EDA68B /* CGLGeoDataProviderYahoo.m in Sources */, 492 | CB91167C105C5CE600EDA68B /* NSString+CGLURLLoadingAdditions.m in Sources */, 493 | CB911682105C5EAD00EDA68B /* CGLURLRequestLoader.m in Sources */, 494 | CB911698105C63D300EDA68B /* NSURLResponse+CGLEncodingAdditions.m in Sources */, 495 | CB0C2FB510606E35006725A8 /* CGLGeoDataProviderGoogle.m in Sources */, 496 | CB0C300C106075DA006725A8 /* CGLXML.m in Sources */, 497 | ); 498 | runOnlyForDeploymentPostprocessing = 0; 499 | }; 500 | /* End PBXSourcesBuildPhase section */ 501 | 502 | /* Begin PBXTargetDependency section */ 503 | CB911704105C6D4800EDA68B /* PBXTargetDependency */ = { 504 | isa = PBXTargetDependency; 505 | target = CB9116D6105C6A8D00EDA68B /* CGLTestApp */; 506 | targetProxy = CB911703105C6D4800EDA68B /* PBXContainerItemProxy */; 507 | }; 508 | CB911706105C6D5000EDA68B /* PBXTargetDependency */ = { 509 | isa = PBXTargetDependency; 510 | target = 8DC2EF4F0486A6940098B216 /* CoreGeoLocation */; 511 | targetProxy = CB911705105C6D5000EDA68B /* PBXContainerItemProxy */; 512 | }; 513 | CB9DBB24105C51AD00EA2DF5 /* PBXTargetDependency */ = { 514 | isa = PBXTargetDependency; 515 | target = 8DC2EF4F0486A6940098B216 /* CoreGeoLocation */; 516 | targetProxy = CB9DBB23105C51AD00EA2DF5 /* PBXContainerItemProxy */; 517 | }; 518 | CB9DBB26105C51B100EA2DF5 /* PBXTargetDependency */ = { 519 | isa = PBXTargetDependency; 520 | target = CB9DBB01105C50A500EA2DF5 /* CoreGeoLocationMobile */; 521 | targetProxy = CB9DBB25105C51B100EA2DF5 /* PBXContainerItemProxy */; 522 | }; 523 | /* End PBXTargetDependency section */ 524 | 525 | /* Begin PBXVariantGroup section */ 526 | 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { 527 | isa = PBXVariantGroup; 528 | children = ( 529 | 089C1667FE841158C02AAC07 /* English */, 530 | ); 531 | name = InfoPlist.strings; 532 | sourceTree = ""; 533 | }; 534 | /* End PBXVariantGroup section */ 535 | 536 | /* Begin XCBuildConfiguration section */ 537 | 1DEB91AE08733DA50010E9CD /* Debug */ = { 538 | isa = XCBuildConfiguration; 539 | buildSettings = { 540 | ALWAYS_SEARCH_USER_PATHS = NO; 541 | COPY_PHASE_STRIP = NO; 542 | DYLIB_COMPATIBILITY_VERSION = 1; 543 | DYLIB_CURRENT_VERSION = 1; 544 | FRAMEWORK_VERSION = A; 545 | GCC_DYNAMIC_NO_PIC = NO; 546 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 547 | GCC_MODEL_TUNING = G5; 548 | GCC_OPTIMIZATION_LEVEL = 0; 549 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 550 | GCC_PREFIX_HEADER = CoreGeoLocation_Prefix.pch; 551 | HEADER_SEARCH_PATHS = /usr/include/libxml2; 552 | INFOPLIST_FILE = Info.plist; 553 | INSTALL_PATH = "$(HOME)/Library/Frameworks"; 554 | PRODUCT_NAME = CoreGeoLocation; 555 | WRAPPER_EXTENSION = framework; 556 | }; 557 | name = Debug; 558 | }; 559 | 1DEB91AF08733DA50010E9CD /* Release */ = { 560 | isa = XCBuildConfiguration; 561 | buildSettings = { 562 | ALWAYS_SEARCH_USER_PATHS = NO; 563 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 564 | DYLIB_COMPATIBILITY_VERSION = 1; 565 | DYLIB_CURRENT_VERSION = 1; 566 | FRAMEWORK_VERSION = A; 567 | GCC_MODEL_TUNING = G5; 568 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 569 | GCC_PREFIX_HEADER = CoreGeoLocation_Prefix.pch; 570 | INFOPLIST_FILE = Info.plist; 571 | INSTALL_PATH = "$(HOME)/Library/Frameworks"; 572 | PRODUCT_NAME = CoreGeoLocation; 573 | WRAPPER_EXTENSION = framework; 574 | }; 575 | name = Release; 576 | }; 577 | 1DEB91B208733DA50010E9CD /* Debug */ = { 578 | isa = XCBuildConfiguration; 579 | buildSettings = { 580 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 581 | GCC_C_LANGUAGE_STANDARD = gnu99; 582 | GCC_OPTIMIZATION_LEVEL = 0; 583 | GCC_VERSION = 4.2; 584 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 585 | GCC_WARN_UNUSED_VARIABLE = YES; 586 | ONLY_ACTIVE_ARCH = YES; 587 | PREBINDING = NO; 588 | SDKROOT = macosx10.6; 589 | }; 590 | name = Debug; 591 | }; 592 | 1DEB91B308733DA50010E9CD /* Release */ = { 593 | isa = XCBuildConfiguration; 594 | buildSettings = { 595 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 596 | GCC_C_LANGUAGE_STANDARD = gnu99; 597 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 598 | GCC_WARN_UNUSED_VARIABLE = YES; 599 | PREBINDING = NO; 600 | SDKROOT = macosx10.6; 601 | }; 602 | name = Release; 603 | }; 604 | CB9116DA105C6A8D00EDA68B /* Debug */ = { 605 | isa = XCBuildConfiguration; 606 | buildSettings = { 607 | ALWAYS_SEARCH_USER_PATHS = NO; 608 | COPY_PHASE_STRIP = NO; 609 | GCC_DYNAMIC_NO_PIC = NO; 610 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 611 | GCC_MODEL_TUNING = G5; 612 | GCC_OPTIMIZATION_LEVEL = 0; 613 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 614 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 615 | INFOPLIST_FILE = "CGLTestApp-Info.plist"; 616 | INSTALL_PATH = "$(HOME)/Applications"; 617 | OTHER_LDFLAGS = ( 618 | "-framework", 619 | Foundation, 620 | "-framework", 621 | AppKit, 622 | ); 623 | PREBINDING = NO; 624 | PRODUCT_NAME = CGLTestApp; 625 | }; 626 | name = Debug; 627 | }; 628 | CB9116DB105C6A8D00EDA68B /* Release */ = { 629 | isa = XCBuildConfiguration; 630 | buildSettings = { 631 | ALWAYS_SEARCH_USER_PATHS = NO; 632 | COPY_PHASE_STRIP = YES; 633 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 634 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 635 | GCC_MODEL_TUNING = G5; 636 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 637 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 638 | INFOPLIST_FILE = "CGLTestApp-Info.plist"; 639 | INSTALL_PATH = "$(HOME)/Applications"; 640 | OTHER_LDFLAGS = ( 641 | "-framework", 642 | Foundation, 643 | "-framework", 644 | AppKit, 645 | ); 646 | PREBINDING = NO; 647 | PRODUCT_NAME = CGLTestApp; 648 | ZERO_LINK = NO; 649 | }; 650 | name = Release; 651 | }; 652 | CB9DBB03105C50A600EA2DF5 /* Debug */ = { 653 | isa = XCBuildConfiguration; 654 | buildSettings = { 655 | ALWAYS_SEARCH_USER_PATHS = NO; 656 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 657 | COPY_PHASE_STRIP = NO; 658 | GCC_DYNAMIC_NO_PIC = NO; 659 | GCC_OPTIMIZATION_LEVEL = 0; 660 | HEADER_SEARCH_PATHS = /usr/include/libxml2; 661 | ONLY_ACTIVE_ARCH = NO; 662 | PREBINDING = NO; 663 | PRODUCT_NAME = CoreGeoLocationMobile; 664 | SDKROOT = iphoneos3.0; 665 | }; 666 | name = Debug; 667 | }; 668 | CB9DBB04105C50A600EA2DF5 /* Release */ = { 669 | isa = XCBuildConfiguration; 670 | buildSettings = { 671 | ALWAYS_SEARCH_USER_PATHS = NO; 672 | COPY_PHASE_STRIP = YES; 673 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 674 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 675 | PREBINDING = NO; 676 | PRODUCT_NAME = CoreGeoLocationMobile; 677 | ZERO_LINK = NO; 678 | }; 679 | name = Release; 680 | }; 681 | CB9DBB21105C51A600EA2DF5 /* Debug */ = { 682 | isa = XCBuildConfiguration; 683 | buildSettings = { 684 | COPY_PHASE_STRIP = NO; 685 | GCC_DYNAMIC_NO_PIC = NO; 686 | GCC_OPTIMIZATION_LEVEL = 0; 687 | PRODUCT_NAME = "Build ALl"; 688 | }; 689 | name = Debug; 690 | }; 691 | CB9DBB22105C51A600EA2DF5 /* Release */ = { 692 | isa = XCBuildConfiguration; 693 | buildSettings = { 694 | COPY_PHASE_STRIP = YES; 695 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 696 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 697 | PRODUCT_NAME = "Build ALl"; 698 | ZERO_LINK = NO; 699 | }; 700 | name = Release; 701 | }; 702 | /* End XCBuildConfiguration section */ 703 | 704 | /* Begin XCConfigurationList section */ 705 | 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CoreGeoLocation" */ = { 706 | isa = XCConfigurationList; 707 | buildConfigurations = ( 708 | 1DEB91AE08733DA50010E9CD /* Debug */, 709 | 1DEB91AF08733DA50010E9CD /* Release */, 710 | ); 711 | defaultConfigurationIsVisible = 0; 712 | defaultConfigurationName = Release; 713 | }; 714 | 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreGeoLocation" */ = { 715 | isa = XCConfigurationList; 716 | buildConfigurations = ( 717 | 1DEB91B208733DA50010E9CD /* Debug */, 718 | 1DEB91B308733DA50010E9CD /* Release */, 719 | ); 720 | defaultConfigurationIsVisible = 0; 721 | defaultConfigurationName = Release; 722 | }; 723 | CB9116DC105C6A8E00EDA68B /* Build configuration list for PBXNativeTarget "CGLTestApp" */ = { 724 | isa = XCConfigurationList; 725 | buildConfigurations = ( 726 | CB9116DA105C6A8D00EDA68B /* Debug */, 727 | CB9116DB105C6A8D00EDA68B /* Release */, 728 | ); 729 | defaultConfigurationIsVisible = 0; 730 | defaultConfigurationName = Release; 731 | }; 732 | CB9DBB0A105C50D100EA2DF5 /* Build configuration list for PBXNativeTarget "CoreGeoLocationMobile" */ = { 733 | isa = XCConfigurationList; 734 | buildConfigurations = ( 735 | CB9DBB03105C50A600EA2DF5 /* Debug */, 736 | CB9DBB04105C50A600EA2DF5 /* Release */, 737 | ); 738 | defaultConfigurationIsVisible = 0; 739 | defaultConfigurationName = Release; 740 | }; 741 | CB9DBB59105C520C00EA2DF5 /* Build configuration list for PBXAggregateTarget "Build All" */ = { 742 | isa = XCConfigurationList; 743 | buildConfigurations = ( 744 | CB9DBB21105C51A600EA2DF5 /* Debug */, 745 | CB9DBB22105C51A600EA2DF5 /* Release */, 746 | ); 747 | defaultConfigurationIsVisible = 0; 748 | defaultConfigurationName = Release; 749 | }; 750 | /* End XCConfigurationList section */ 751 | }; 752 | rootObject = 0867D690FE84028FC02AAC07 /* Project object */; 753 | } 754 | -------------------------------------------------------------------------------- /CoreGeoLocation_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CoreGeoLocation' target in the 'CoreGeoLocation' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleName 10 | ${PRODUCT_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.matrixPointer.${PRODUCT_NAME:rfc1034Identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | CFBundleShortVersionString 24 | 1.0 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thekarladam/CoreGeoLocation/d89f6044b330d4f96d454e7139f82afd0a8f03c8/README -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | CoreGeoLocation 2 | ========= 3 | 4 | An Objective GeoCoder and Reverse Geocoder wrapping around [Yahoo's Geocoding services](http://developer.yahoo.com/maps/rest/V1/geocode.html) or [Google's Geo APIs](http://code.google.com/apis/maps/documentation/geocoding/index.html#GeocodingRequests) primarily. 5 | 6 | UPDATES 7 | ------- 8 | 9 | Code is hosted at GitHub: [http://github.com/thekarladam/coregeolocation](http://github.com/thekarladam/coregeolocation). 10 | Originally based on objc-geocoder [http://github.com/tylerhall/objc-geocoder](http://github.com/tylerhall/objc-geocoder) 11 | 12 | LICENSE 13 | ------- 14 | 15 | The MIT License 16 | 17 | Copyright (c) 2009 Karl Adam 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | -------------------------------------------------------------------------------- /Source/Additions/NSString+CGLURLLoadingAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+CGLURLEscapingAdditions.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Yahoo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSString (CGLURLLoadingAdditions) 13 | - (NSString *)cglEscapedURLEncodedString; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/Additions/NSString+CGLURLLoadingAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+CGLURLEscapingAdditions.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "NSString+CGLURLLoadingAdditions.h" 10 | 11 | 12 | @implementation NSString (CGLURLLoadingAdditions) 13 | 14 | - (NSString *)cglEscapedURLEncodedString { 15 | NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, 16 | (CFStringRef)self, 17 | NULL, 18 | (CFStringRef)@";/?:@&=$+{}<>,", 19 | kCFStringEncodingUTF8); 20 | return [result autorelease]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/CGLGeoDataProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoDataProvider.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | 11 | @class CGLGeoLocation; 12 | @class CGLGeoRequest; 13 | 14 | @protocol CGLGeoDataProviderDelegate; 15 | 16 | @interface CGLGeoDataProvider : NSObject { 17 | id delegate_; 18 | } 19 | 20 | @property (nonatomic, readwrite, assign) id delegate; 21 | 22 | + (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest; 23 | 24 | - (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest; 25 | - (void)performRequest:(CGLGeoRequest *)inRequest; 26 | 27 | @end 28 | 29 | @protocol CGLGeoDataProviderDelegate 30 | - (void)geoLocation:(CGLGeoLocation *)inGeoLocation determinedForRequest:(CGLGeoRequest *)inRequest; 31 | @end -------------------------------------------------------------------------------- /Source/CGLGeoDataProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoDataProvider.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLGeoDataProvider.h" 10 | 11 | 12 | @implementation CGLGeoDataProvider 13 | 14 | + (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest { 15 | return NO; 16 | } 17 | 18 | @synthesize delegate = delegate_; 19 | 20 | - (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest { 21 | return [[self class] canHandleRequest:inRequest]; 22 | } 23 | 24 | - (void)performRequest:(CGLGeoRequest *)inRequest { 25 | // you lose 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/CGLGeoDataProviderGoogle.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoDataProviderGoogle.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.15. 6 | // Copyright 2009 Yahoo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGLGeoDataProvider.h" 11 | 12 | @interface CGLGeoDataProviderGoogle : CGLGeoDataProvider { 13 | NSString *apiKey_; 14 | NSMutableDictionary *requestsMapping_; 15 | } 16 | 17 | @property (nonatomic, readwrite, retain) NSString *apiKey; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/CGLGeoDataProviderGoogle.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoDataProviderGoogle.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.15. 6 | // Copyright 2009 Yahoo. All rights reserved. 7 | // 8 | 9 | #import "CGLGeoDataProviderGoogle.h" 10 | #import "CGLGeoRequest.h" 11 | #import "CGLGeoLocation.h" 12 | #import "CGLURLRequestLoader.h" 13 | 14 | #import "CGLXML.h" 15 | #import "NSString+CGLURLLoadingAdditions.h" 16 | 17 | #import 18 | #import 19 | #import 20 | 21 | 22 | @interface CGLGeoDataProviderGoogle () 23 | @property (nonatomic, readwrite, retain) NSMutableDictionary *requestsMapping; 24 | 25 | - (CGLGeoLocation *)_geoLocationFromXML:(NSString *)inXMLString; 26 | @end 27 | 28 | 29 | @implementation CGLGeoDataProviderGoogle 30 | 31 | - (id)init { 32 | if (self = [super init]) { 33 | self.requestsMapping = [NSMutableDictionary dictionaryWithCapacity:15]; 34 | } 35 | return self; 36 | } 37 | 38 | - (oneway void)dealloc { 39 | self.apiKey = nil; 40 | self.requestsMapping = nil; 41 | 42 | [super dealloc]; 43 | } 44 | 45 | @synthesize apiKey = apiKey_; 46 | @synthesize requestsMapping = requestsMapping_; 47 | 48 | #pragma mark - 49 | 50 | - (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest { 51 | BOOL canHandleRequest = NO; 52 | 53 | 54 | if ([self.apiKey length]) { 55 | canHandleRequest = [super canHandleRequest:inRequest]; 56 | } 57 | 58 | return canHandleRequest; 59 | } 60 | 61 | - (void)performRequest:(CGLGeoRequest *)inRequest { 62 | NSString *query = nil; 63 | if ([inRequest address]) { 64 | query = [inRequest address]; 65 | } else if ([inRequest location]) { 66 | CLLocationCoordinate2D coordinate = [[inRequest location] coordinate]; 67 | query = [NSString stringWithFormat:@"%f,%f", coordinate.latitude, coordinate.longitude]; 68 | } 69 | 70 | if (query) { 71 | NSMutableString *urlString = [NSMutableString stringWithString:@"http://maps.google.com/maps/geo?"]; 72 | 73 | [urlString appendFormat:@"q=%@&", [query cglEscapedURLEncodedString]]; 74 | [urlString appendFormat:@"key=%@&", [self.apiKey cglEscapedURLEncodedString]]; 75 | [urlString appendString:@"sensor=true&output=xml&oe=utf-8"]; 76 | 77 | NSURLRequest *loadRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]; 78 | 79 | [CGLURLRequestLoader loaderWithRequest:loadRequest target:self action:@selector(loader:loadedData:usingEncoding:)]; 80 | [self.requestsMapping setObject:inRequest forKey:loadRequest]; 81 | } 82 | } 83 | 84 | - (void)loader:(CGLURLRequestLoader *)inLoader loadedData:(NSData *)inData usingEncoding:(NSStringEncoding)inEncoding { 85 | CGLGeoLocation *geoLocation = nil; 86 | NSString *responseString = [[NSString alloc] initWithData:inData encoding:inEncoding]; 87 | 88 | if (responseString) { 89 | NSLog(@"responseString: %@", responseString); 90 | geoLocation = [self _geoLocationFromXML:responseString]; 91 | } 92 | 93 | [self.delegate geoLocation:geoLocation determinedForRequest:[self.requestsMapping objectForKey:[inLoader urlRequest]]]; 94 | [self.requestsMapping removeObjectForKey:[inLoader urlRequest]]; 95 | 96 | [responseString release]; 97 | } 98 | 99 | - (CGLGeoLocation *)_geoLocationFromXML:(NSString *)inXMLString { 100 | CGLGeoLocation *geoLocation = nil; 101 | 102 | if ([inXMLString length]) { 103 | const char *xmlCString = [inXMLString UTF8String]; 104 | xmlParserCtxtPtr parserContext = xmlNewParserCtxt(); 105 | xmlDocPtr locationXML = xmlCtxtReadMemory(parserContext, xmlCString, strlen(xmlCString), NULL, NULL, XML_PARSE_NOBLANKS); 106 | xmlNodePtr rootNode = xmlDocGetRootElement(locationXML); 107 | xmlNodePtr resultNode = rootNode->children; 108 | 109 | NSString *name = nil; 110 | NSString *latitude = nil; 111 | NSString *longitude = nil; 112 | 113 | if (resultNode) { 114 | xmlNodePtr placemarkNode = cgl_xmlNodeGetChildNodeNamed(resultNode, "Placemark"); 115 | xmlNodePtr nameNode = cgl_xmlNodeGetChildNodeNamed(placemarkNode, "address"); 116 | xmlNodePtr pointNode = cgl_xmlNodeGetChildNodeNamed(placemarkNode, "Point"); 117 | xmlNodePtr coordinateNode = cgl_xmlNodeGetChildNodeNamed(pointNode, "coordinates"); 118 | name = [NSString stringWithUTF8String:(const char *)xmlNodeGetContent(nameNode)]; 119 | NSString *coordinates = [NSString stringWithUTF8String:(const char *)xmlNodeGetContent(coordinateNode)]; 120 | NSArray *coordinateParts = [coordinates componentsSeparatedByString:@","]; 121 | latitude = [coordinateParts objectAtIndex:0]; 122 | longitude = [coordinateParts objectAtIndex:1]; 123 | 124 | if (latitude && longitude) { 125 | CLLocation *location = [[CLLocation alloc] initWithLatitude:[latitude doubleValue] longitude:[longitude doubleValue]]; 126 | geoLocation = [[[CGLGeoLocation alloc] initWithName:name andCoreLocation:location] autorelease]; 127 | [location release]; 128 | } 129 | } 130 | 131 | xmlFreeDoc(locationXML); 132 | xmlFreeParserCtxt(parserContext); 133 | xmlCleanupMemory(); 134 | } 135 | 136 | return geoLocation; 137 | } 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /Source/CGLGeoDataProviderYahoo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoDataProviderYahoo.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | #import "CGLGeoDataProvider.h" 11 | 12 | @interface CGLGeoDataProviderYahoo : CGLGeoDataProvider { 13 | NSString *applicationID_; 14 | NSMutableDictionary *requestsMapping_; 15 | } 16 | 17 | @property (nonatomic, readwrite, retain) NSString *applicationID; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/CGLGeoDataProviderYahoo.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoDataProviderYahoo.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLGeoDataProviderYahoo.h" 10 | #import "CGLURLRequestLoader.h" 11 | #import "CGLGeoRequest.h" 12 | #import "CGLGeoLocation.h" 13 | #import "NSString+CGLURLLoadingAdditions.h" 14 | 15 | #import 16 | #import 17 | #import 18 | 19 | @interface CGLGeoDataProviderYahoo () 20 | @property (nonatomic, readwrite, retain) NSMutableDictionary *requestsMapping; 21 | 22 | - (void)_performRequestUsingAddress:(CGLGeoRequest *)inRequest; 23 | - (CGLGeoLocation *)_geoLocationFromXML:(NSString *)inXMLString; 24 | - (void)_performRequestUsingLatitudeAndLongitude:(CGLGeoRequest *)inRequest; 25 | @end 26 | 27 | @implementation CGLGeoDataProviderYahoo 28 | 29 | + (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest { 30 | BOOL canHandleRequest = [super canHandleRequest:inRequest]; 31 | 32 | if ([inRequest address]) { 33 | canHandleRequest = YES; 34 | } 35 | 36 | return canHandleRequest; 37 | } 38 | 39 | - (id)init { 40 | if (self = [super init]) { 41 | self.requestsMapping = [NSMutableDictionary dictionaryWithCapacity:15]; 42 | } 43 | return self; 44 | } 45 | 46 | - (oneway void)dealloc { 47 | self.applicationID = nil; 48 | self.requestsMapping = nil; 49 | 50 | [super dealloc]; 51 | } 52 | 53 | @synthesize applicationID = applicationID_; 54 | @synthesize requestsMapping = requestsMapping_; 55 | 56 | #pragma mark - 57 | 58 | - (BOOL)canHandleRequest:(CGLGeoRequest *)inRequest { 59 | BOOL canHandleRequest = NO; 60 | 61 | 62 | if ([self.applicationID length]) { 63 | canHandleRequest = [super canHandleRequest:inRequest]; 64 | } 65 | 66 | return canHandleRequest; 67 | } 68 | 69 | - (void)performRequest:(CGLGeoRequest *)inRequest { 70 | if ([inRequest address]) { 71 | [self _performRequestUsingAddress:inRequest]; 72 | } else { 73 | [self _performRequestUsingLatitudeAndLongitude:inRequest]; 74 | } 75 | } 76 | 77 | - (void)_performRequestUsingAddress:(CGLGeoRequest *)inRequest { 78 | NSMutableString *urlString = [NSMutableString stringWithString:@"http://local.yahooapis.com/MapsService/V1/geocode?"]; 79 | 80 | [urlString appendFormat:@"appid=%@&", [self.applicationID cglEscapedURLEncodedString]]; 81 | [urlString appendFormat:@"location=%@&", [inRequest.address cglEscapedURLEncodedString]]; 82 | 83 | NSURLRequest *loadRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]; 84 | 85 | [CGLURLRequestLoader loaderWithRequest:loadRequest target:self action:@selector(loader:loadedData:usingEncoding:)]; 86 | [self.requestsMapping setObject:inRequest forKey:loadRequest]; 87 | } 88 | 89 | - (void)_performRequestUsingLatitudeAndLongitude:(CGLGeoRequest *)inRequest { 90 | [NSException raise:@"Net Yet Implemented" format:@"Please Implement Me"]; 91 | } 92 | 93 | - (CGLGeoLocation *)_geoLocationFromXML:(NSString *)inXMLString { 94 | CGLGeoLocation *geoLocation = nil; 95 | 96 | if ([inXMLString length]) { 97 | const char *xmlCString = [inXMLString UTF8String]; 98 | xmlParserCtxtPtr parserContext = xmlNewParserCtxt(); 99 | xmlDocPtr locationXML = xmlCtxtReadMemory(parserContext, xmlCString, strlen(xmlCString), NULL, NULL, XML_PARSE_NOBLANKS); 100 | xmlNodePtr rootNode = xmlDocGetRootElement(locationXML); 101 | xmlNodePtr resultNode = rootNode->children; 102 | const char *currentNodeName = NULL; 103 | 104 | NSString *latitude = nil; 105 | NSString *longitude = nil; 106 | NSString *address = nil; 107 | NSString *city = nil; 108 | NSString *state = nil; 109 | NSString *zip = nil; 110 | NSString *country = nil; 111 | 112 | if (resultNode) { 113 | // we only process the first Result 114 | xmlNodePtr currentNode = resultNode->children; 115 | 116 | for ( ; currentNode; currentNode = currentNode->next) { 117 | currentNodeName = (const char *)currentNode->name; 118 | if (strcmp("Latitude", currentNodeName) == 0) { 119 | latitude = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 120 | } else if (strcmp("Longitude", currentNodeName) == 0) { 121 | longitude = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 122 | } else if (strcmp("Address", currentNodeName) == 0) { 123 | address = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 124 | } else if (strcmp("City", currentNodeName) == 0) { 125 | city = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 126 | } else if (strcmp("State", currentNodeName) == 0) { 127 | state = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 128 | } else if (strcmp("Zip", currentNodeName) == 0) { 129 | zip = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 130 | } else if (strcmp("Country", currentNodeName) == 0) { 131 | country = [NSString stringWithCString:(const char *)xmlNodeGetContent(currentNode) encoding:NSUTF8StringEncoding]; 132 | } 133 | } 134 | if (latitude && longitude) { 135 | CLLocation *location = [[CLLocation alloc] initWithLatitude:[latitude doubleValue] longitude:[longitude doubleValue]]; 136 | geoLocation = [[[CGLGeoLocation alloc] initWithAddress:address city:city state:state zip:zip country:country andCoreLocation:location] autorelease]; 137 | [location release]; 138 | } 139 | } 140 | 141 | xmlFreeDoc(locationXML); 142 | xmlFreeParserCtxt(parserContext); 143 | xmlCleanupMemory(); 144 | } 145 | 146 | return geoLocation; 147 | } 148 | 149 | #pragma mark - 150 | 151 | - (void)loader:(CGLURLRequestLoader *)inLoader loadedData:(NSData *)inData usingEncoding:(NSStringEncoding)inEncoding { 152 | CGLGeoLocation *geoLocation = nil; 153 | NSString *responseString = [[NSString alloc] initWithData:inData encoding:inEncoding]; 154 | 155 | if (responseString) { 156 | NSLog(@"responseString: %@", responseString); 157 | geoLocation = [self _geoLocationFromXML:responseString]; 158 | } 159 | 160 | [self.delegate geoLocation:geoLocation determinedForRequest:[self.requestsMapping objectForKey:[inLoader urlRequest]]]; 161 | [self.requestsMapping removeObjectForKey:[inLoader urlRequest]]; 162 | 163 | [responseString release]; 164 | } 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /Source/CGLGeoLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoLocation.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CGLGeoLocation : NSObject { 13 | NSString *name_; 14 | NSString *address_; 15 | NSString *city_; 16 | NSString *state_; 17 | NSString *zip_; 18 | NSString *country_; 19 | CLLocation *coreLocation_; 20 | } 21 | 22 | @property (nonatomic, readwrite, copy) NSString *name; 23 | @property (nonatomic, readonly, copy) NSString *address; 24 | @property (nonatomic, readonly, copy) NSString *city; 25 | @property (nonatomic, readonly, copy) NSString *state; 26 | @property (nonatomic, readonly, retain) NSString *zip; 27 | @property (nonatomic, readonly, copy) NSString *country; 28 | @property (nonatomic, readonly, retain) CLLocation *coreLocation; 29 | 30 | - (id)initWithAddress:(NSString *)inAddress city:(NSString *)inCity state:(NSString *)inState zip:(NSString *)inZip country:(NSString *)inCountry andCoreLocation:(CLLocation *)inLocation; 31 | - (id)initWithName:(NSString *)inName andCoreLocation:(CLLocation *)inLocation; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/CGLGeoLocation.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoLocation.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLGeoLocation.h" 10 | 11 | @interface CGLGeoLocation () 12 | @property (nonatomic, readwrite, copy) NSString *address; 13 | @property (nonatomic, readwrite, copy) NSString *city; 14 | @property (nonatomic, readwrite, copy) NSString *state; 15 | @property (nonatomic, readwrite, retain) NSString *zip; 16 | @property (nonatomic, readwrite, copy) NSString *country; 17 | @property (nonatomic, readwrite, retain) CLLocation *coreLocation; 18 | 19 | @end 20 | 21 | @implementation CGLGeoLocation 22 | 23 | - (id)initWithAddress:(NSString *)inAddress city:(NSString *)inCity state:(NSString *)inState zip:(NSString *)inZip country:(NSString *)inCountry andCoreLocation:(CLLocation *)inLocation { 24 | if (self = [super init]) { 25 | self.address = inAddress; 26 | self.city = inCity; 27 | self.state = inState; 28 | self.zip = inZip; 29 | self.country = inCountry; 30 | self.coreLocation = inLocation; 31 | } 32 | return self; 33 | } 34 | 35 | - (id)initWithName:(NSString *)inName andCoreLocation:(CLLocation *)inLocation { 36 | if (self = [super init]) { 37 | self.name = inName; 38 | self.coreLocation = inLocation; 39 | } 40 | return self; 41 | } 42 | 43 | - (oneway void)dealloc { 44 | self.address = nil; 45 | self.city = nil; 46 | self.state = nil; 47 | self.zip = nil; 48 | self.country = nil; 49 | self.coreLocation = nil; 50 | 51 | [super dealloc]; 52 | } 53 | 54 | @synthesize name = name_; 55 | @synthesize address = address_; 56 | @synthesize city = city_; 57 | @synthesize state = state_; 58 | @synthesize zip = zip_; 59 | @synthesize country = country_; 60 | @synthesize coreLocation = coreLocation_; 61 | 62 | #pragma mark - 63 | 64 | - (NSString *)description { 65 | return [NSString stringWithFormat:@"<%@:%p name: \"%@\" address: \"%@\" city: \"%@\" state: \"%@\" zip: %@ country: %@ location: %@>", NSStringFromClass([self class]), self, name_, address_, city_, state_, zip_, country_, coreLocation_]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Source/CGLGeoManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoManager.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | #import 11 | #import "CGLGeoDataProvider.h" 12 | 13 | @class CGLGeoRequest; 14 | @class CGLGeoLocation; 15 | @class CGLGeoDataProvider; 16 | 17 | @protocol CGLGeoManagerDelegate; 18 | 19 | @interface CGLGeoManager : NSObject { 20 | NSMutableArray *outstandingRequests_; 21 | CGLGeoDataProvider *dataProvider_; 22 | id delegate_; 23 | } 24 | 25 | @property (nonatomic, readwrite, retain) CGLGeoDataProvider *dataProvider; 26 | @property (nonatomic, readwrite, assign) id delegate; 27 | 28 | + (CGLGeoManager *)sharedManager; 29 | 30 | - (void)determineGeographicalNameWithRequest:(CGLGeoRequest *)inRequest; 31 | - (CGLGeoRequest *)determineGeographicalNameForAddress:(NSString *)inAddress; 32 | - (CGLGeoRequest *)determineGeographicalNameForLocation:(CLLocation *)inLocation; 33 | 34 | @end 35 | 36 | @protocol CGLGeoManagerDelegate 37 | - (void)geoManager:(CGLGeoManager *)inGeoManager determinedLocation:(CGLGeoLocation *)inLocation forRequest:(CGLGeoRequest *)inRequest; 38 | @end -------------------------------------------------------------------------------- /Source/CGLGeoManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoManager.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLGeoManager.h" 10 | #import "CGLGeoRequest.h" 11 | #import "CGLGeoDataProvider.h" 12 | 13 | static CGLGeoManager *_theStaticGeoManagerInstance = nil; 14 | 15 | @interface CGLGeoManager () 16 | @property (nonatomic, readwrite, retain) NSMutableArray *outstandingRequests; 17 | @end 18 | 19 | @implementation CGLGeoManager 20 | 21 | + (CGLGeoManager *)sharedManager { 22 | if (!_theStaticGeoManagerInstance) { 23 | _theStaticGeoManagerInstance = [[self alloc] init]; 24 | } 25 | 26 | return _theStaticGeoManagerInstance; 27 | } 28 | 29 | - (id)init { 30 | if (self = [super init]) { 31 | self.outstandingRequests = [NSMutableArray arrayWithCapacity:15]; 32 | } 33 | return self; 34 | } 35 | 36 | - (oneway void)dealloc { 37 | self.dataProvider = nil; 38 | self.delegate = nil; 39 | self.outstandingRequests = nil; 40 | 41 | [super dealloc]; 42 | } 43 | 44 | @synthesize dataProvider = dataProvider_; 45 | @synthesize delegate = delegate_; 46 | @synthesize outstandingRequests = outstandingRequests_; 47 | 48 | - (void)setDataProvider:(CGLGeoDataProvider *)inDataProvider { 49 | [inDataProvider retain]; 50 | [dataProvider_ release]; 51 | dataProvider_ = inDataProvider; 52 | [dataProvider_ setDelegate:self]; 53 | } 54 | 55 | #pragma mark - 56 | 57 | - (void)determineGeographicalNameWithRequest:(CGLGeoRequest *)inRequest { 58 | [self.dataProvider performRequest:inRequest]; 59 | } 60 | 61 | - (CGLGeoRequest *)determineGeographicalNameForAddress:(NSString *)inAddress { 62 | CGLGeoRequest *geoRequest = [[CGLGeoRequest alloc] initWithAddress:inAddress]; 63 | [self determineGeographicalNameWithRequest:geoRequest]; 64 | return geoRequest; 65 | } 66 | 67 | - (CGLGeoRequest *)determineGeographicalNameForLocation:(CLLocation *)inLocation { 68 | CGLGeoRequest *geoRequest = [[CGLGeoRequest alloc] initWithLocation:inLocation]; 69 | [self determineGeographicalNameWithRequest:geoRequest]; 70 | return geoRequest; 71 | } 72 | 73 | #pragma mark - 74 | 75 | - (void)geoLocation:(CGLGeoLocation *)inGeoLocation determinedForRequest:(CGLGeoRequest *)inRequest { 76 | [self.delegate geoManager:self determinedLocation:inGeoLocation forRequest:inRequest]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Source/CGLGeoRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoRequest.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CGLGeoRequest : NSObject { 13 | NSString *address_; 14 | CLLocation *location_; 15 | } 16 | 17 | @property (nonatomic, readonly, copy) NSString *address; 18 | @property (nonatomic, readonly, retain) CLLocation *location; 19 | 20 | - (id)initWithLocation:(CLLocation *)inLocation; 21 | - (id)initWithAddress:(NSString *)inAddress; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/CGLGeoRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLGeoRequest.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLGeoRequest.h" 10 | 11 | @interface CGLGeoRequest () 12 | @property (nonatomic, readwrite, copy) NSString *address; 13 | @property (nonatomic, readwrite, retain) CLLocation *location; 14 | @end 15 | 16 | @implementation CGLGeoRequest 17 | 18 | - (id)initWithLocation:(CLLocation *)inLocation { 19 | if (self = [super init]) { 20 | self.location = inLocation; 21 | } 22 | return self; 23 | } 24 | 25 | - (id)initWithAddress:(NSString *)inAddress { 26 | if (self = [super init]) { 27 | self.address = inAddress; 28 | } 29 | return self; 30 | } 31 | 32 | 33 | - (oneway void)dealloc { 34 | self.address = nil; 35 | self.location = nil; 36 | 37 | [super dealloc]; 38 | } 39 | 40 | @synthesize address = address_; 41 | @synthesize location = location_; 42 | 43 | #pragma mark - 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Source/CGLURLRequestLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLURLRequestLoader.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | 11 | // A Private Implementaion Detail to get around the stupid limitations of NSURLConnection 12 | 13 | @interface CGLURLRequestLoader : NSObject { 14 | NSURLRequest *urlRequest_; 15 | NSURLResponse *urlResponse_; 16 | NSURLConnection *urlConnection_; 17 | NSStringEncoding responseEncoding_; 18 | NSMutableData *data_; 19 | 20 | id target_; 21 | SEL selector_; 22 | } 23 | 24 | @property (nonatomic, readonly, retain) NSURLRequest *urlRequest; 25 | @property (nonatomic, readonly, retain) NSURLResponse *urlResponse; 26 | @property (nonatomic, readonly, retain) NSURLConnection *urlConnection; 27 | @property (nonatomic, readonly, assign) NSStringEncoding responseEncoding; 28 | @property (nonatomic, readonly, retain) NSMutableData *data; 29 | @property (nonatomic, readwrite, assign) id target; 30 | @property (nonatomic, readwrite, assign) SEL action; 31 | 32 | 33 | + (CGLURLRequestLoader *)loaderWithRequest:(NSURLRequest *)inRequest target:(id)inTarget action:(SEL)inSelector; 34 | - (id)initWithRequest:(NSURLRequest *)inRequest target:(id)inTarget action:(SEL)inSelector; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Source/CGLURLRequestLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLURLRequestLoader.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLURLRequestLoader.h" 10 | #import "NSURLResponse+CGLEncodingAdditions.h" 11 | 12 | @interface CGLURLRequestLoader () 13 | @property (nonatomic, readwrite, retain) NSURLRequest *urlRequest; 14 | @property (nonatomic, readwrite, retain) NSURLResponse *urlResponse; 15 | @property (nonatomic, readwrite, retain) NSURLConnection *urlConnection; 16 | @property (nonatomic, readwrite, assign) NSStringEncoding responseEncoding; 17 | @property (nonatomic, readwrite, retain) NSMutableData *data; 18 | 19 | @end 20 | 21 | @implementation CGLURLRequestLoader 22 | 23 | + (CGLURLRequestLoader *)loaderWithRequest:(NSURLRequest *)inRequest target:(id)inTarget action:(SEL)inSelector { 24 | return [[[self alloc] initWithRequest:inRequest target:inTarget action:inSelector] autorelease]; 25 | } 26 | 27 | - (id)initWithRequest:(NSURLRequest *)inRequest target:(id)inTarget action:(SEL)inAction { 28 | if (self = [super init]) { 29 | self.target = inTarget; 30 | self.action = inAction; 31 | self.data = [NSMutableData data]; 32 | self.urlRequest = inRequest; 33 | [NSURLConnection connectionWithRequest:inRequest delegate:self]; 34 | } 35 | 36 | return self; 37 | } 38 | 39 | - (oneway void)dealloc { 40 | self.urlRequest = nil; 41 | self.urlResponse = nil; 42 | self.urlConnection = nil; 43 | self.data = nil; 44 | 45 | [super dealloc]; 46 | } 47 | 48 | @synthesize urlRequest = urlRequest_; 49 | @synthesize urlResponse = urlResponse_; 50 | @synthesize urlConnection = urlConnection_; 51 | @synthesize responseEncoding = responseEncoding_; 52 | @synthesize data = data_; 53 | @synthesize target = target_; 54 | @synthesize action = selector_; 55 | 56 | #pragma mark - 57 | 58 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { 59 | self.urlResponse = response; 60 | self.responseEncoding = [response cglEncoding]; 61 | } 62 | 63 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { 64 | [self.data appendData:data]; 65 | } 66 | 67 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection { 68 | 69 | NSMethodSignature *methodSignature = [self.target methodSignatureForSelector:self.action]; 70 | if (methodSignature) { 71 | NSInvocation *anInvocation = [NSInvocation invocationWithMethodSignature:methodSignature]; 72 | [anInvocation setTarget:self.target]; 73 | [anInvocation setSelector:self.action]; 74 | [anInvocation setArgument:&self atIndex:2]; 75 | [anInvocation setArgument:&data_ atIndex:3]; 76 | [anInvocation setArgument:&responseEncoding_ atIndex:4]; 77 | [anInvocation retainArguments]; 78 | 79 | [anInvocation invoke]; 80 | } 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Source/CoreGeoLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreGeoLocation.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | -------------------------------------------------------------------------------- /Source/NSURLResponse+CGLEncodingAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLResponse+CGLEncodingAdditions.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Yahoo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSURLResponse (CGLEncodingAdditions) 13 | 14 | - (NSStringEncoding)cglEncoding; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/NSURLResponse+CGLEncodingAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLResponse+CGLEncodingAdditions.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "NSURLResponse+CGLEncodingAdditions.h" 10 | 11 | 12 | @implementation NSURLResponse (CGLEncodingAdditions) 13 | 14 | - (NSStringEncoding)cglEncoding { 15 | NSStringEncoding encoding = NSUTF8StringEncoding; 16 | 17 | if ([self textEncodingName]) { 18 | CFStringEncoding cfStringEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)[self textEncodingName]); 19 | if (cfStringEncoding != kCFStringEncodingInvalidId) { 20 | encoding = CFStringConvertEncodingToNSStringEncoding(cfStringEncoding); 21 | } 22 | } 23 | 24 | return encoding; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/Test App/CGLTestAppController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLTestAppController.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Yahoo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class CGLGeoRequest; 13 | 14 | @interface CGLTestAppController : NSObject { 15 | IBOutlet NSTextField *locationTextField; 16 | IBOutlet NSTextField *latitudeTextField; 17 | IBOutlet NSTextField *longitudeTextField; 18 | IBOutlet NSTextView *outputTextView; 19 | IBOutlet NSProgressIndicator *progressIndicator; 20 | 21 | CGLGeoRequest *currentGeoRequest; 22 | } 23 | 24 | @property (nonatomic, readwrite, retain) CGLGeoRequest *currentGeoRequest; 25 | 26 | - (IBAction)lookup:(id)sender; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/Test App/CGLTestAppController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLTestAppController.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Karl Adam. All rights reserved. 7 | // 8 | 9 | #import "CGLTestAppController.h" 10 | #import 11 | #import 12 | 13 | #define kYahooApplicationID @"" 14 | #define kGoogleAPIKey @"" 15 | 16 | @implementation CGLTestAppController 17 | 18 | @synthesize currentGeoRequest; 19 | 20 | - (void)awakeFromNib { 21 | if ([kYahooApplicationID length]) { 22 | CGLGeoDataProviderYahoo *yahooDataProvider = [[CGLGeoDataProviderYahoo alloc] init]; 23 | [yahooDataProvider setApplicationID:kYahooApplicationID]; 24 | [[CGLGeoManager sharedManager] setDataProvider:yahooDataProvider]; 25 | [yahooDataProvider release]; 26 | [[CGLGeoManager sharedManager] setDelegate:self]; 27 | } else if ([kGoogleAPIKey length]) { 28 | CGLGeoDataProviderGoogle *googleDataProvider = [[CGLGeoDataProviderGoogle alloc] init]; 29 | [googleDataProvider setApiKey:kGoogleAPIKey]; 30 | [[CGLGeoManager sharedManager] setDataProvider:googleDataProvider]; 31 | [googleDataProvider release]; 32 | [[CGLGeoManager sharedManager] setDelegate:self]; 33 | } else { 34 | [NSException raise:@"Missing Y! AppID or Google API Key" format:@"You Need to provide either an Yahoo! application ID for Yahoo!'s GeoPlanet APIs or a Google API Key for using Google's Geo Web Services"]; 35 | } 36 | } 37 | 38 | - (IBAction)lookup:(id)sender { 39 | NSString *locationAddress = [locationTextField stringValue]; 40 | NSString *latitude = [latitudeTextField stringValue]; 41 | NSString *longitude = [longitudeTextField stringValue]; 42 | 43 | 44 | if ([locationAddress length]) { 45 | [progressIndicator setHidden:NO]; 46 | [progressIndicator startAnimation:self]; 47 | 48 | CGLGeoRequest *geoRequest = [[CGLGeoManager sharedManager] determineGeographicalNameForAddress:locationAddress]; 49 | self.currentGeoRequest = geoRequest; 50 | } else if ([latitude length] && [longitude length]) { 51 | CLLocation *location = [[[CLLocation alloc] initWithLatitude:[latitude doubleValue] longitude:[longitude doubleValue]] autorelease]; 52 | CGLGeoRequest *geoRequest = [[CGLGeoManager sharedManager] determineGeographicalNameForLocation:location]; 53 | self.currentGeoRequest = geoRequest; 54 | } 55 | } 56 | 57 | - (void)geoManager:(CGLGeoManager *)inGeoManager determinedLocation:(CGLGeoLocation *)inLocation forRequest:(CGLGeoRequest *)inRequest { 58 | [progressIndicator setHidden:YES]; 59 | [progressIndicator stopAnimation:self]; 60 | [outputTextView setString:[inLocation description]]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Source/Test App/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.12. 6 | // Copyright 2009 Yahoo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } -------------------------------------------------------------------------------- /Source/Utilities/CGLXML.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGLXML.h 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.15. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | 14 | xmlNodePtr cgl_xmlNodeGetChildNodeNamed(xmlNodePtr parentNode, const char *soughtNodeName); 15 | -------------------------------------------------------------------------------- /Source/Utilities/CGLXML.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGLXML.m 3 | // CoreGeoLocation 4 | // 5 | // Created by Karl Adam on 09.09.15. 6 | // Copyright 2009 Karl Adam. BSD Licensed, check ReadMe.markdown for details 7 | // 8 | 9 | #import "CGLXML.h" 10 | #import 11 | 12 | 13 | xmlNodePtr cgl_xmlNodeGetChildNodeNamed(xmlNodePtr inParentNode, const char *soughtNodeName) { 14 | xmlNodePtr foundNode = NULL; 15 | 16 | if (inParentNode) { 17 | xmlNodePtr currentNode = inParentNode->children; 18 | 19 | for ( ; currentNode; currentNode = currentNode->next) { 20 | if (strcmp(soughtNodeName, (const char *)currentNode->name) == 0) { 21 | foundNode = currentNode; 22 | break; 23 | } 24 | } 25 | } 26 | 27 | return foundNode; 28 | } 29 | --------------------------------------------------------------------------------