├── .gitignore ├── Default-568h@2x.png ├── README.md ├── areapicker.xcodeproj └── project.pbxproj └── areapicker ├── AppDelegate.h ├── AppDelegate.m ├── HZAreaPickerView.h ├── HZAreaPickerView.m ├── HZAreaPickerView.xib ├── HZLocation.h ├── HZLocation.m ├── ViewController.h ├── ViewController.m ├── area.plist ├── areapicker-Info.plist ├── areapicker-Prefix.pch ├── city.plist ├── en.lproj ├── InfoPlist.strings └── ViewController.xib └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build 3 | Build 4 | Products 5 | *.pbxuser 6 | *.perspectivev3 7 | *.mode1v3 8 | xcuserdata 9 | .DS_Store 10 | config 11 | extensions/ 12 | 13 | *.pyc 14 | Docs 15 | 16 | *.xcworkspace 17 | -------------------------------------------------------------------------------- /Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudorz/areapicker/c2e42a9996136449595fb133783bcb47a4420260/Default-568h@2x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 中国省市地区选择器 3 | 4 | ## 使用 5 | 1. 将area picker group 下的全部文件拖到你的项目下。 6 | 2. 添加QuartzCore.framework 7 | 8 | 具体看实例 9 | 10 | ![snapshot](http://ww4.sinaimg.cn/bmiddle/76770db5gw1dwr6gax695j.jpg) -------------------------------------------------------------------------------- /areapicker.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 619CFB6615FCD223002A122D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 619CFB6515FCD223002A122D /* UIKit.framework */; }; 11 | 619CFB6815FCD223002A122D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 619CFB6715FCD223002A122D /* Foundation.framework */; }; 12 | 619CFB6A15FCD223002A122D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 619CFB6915FCD223002A122D /* CoreGraphics.framework */; }; 13 | 619CFB7015FCD223002A122D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 619CFB6E15FCD223002A122D /* InfoPlist.strings */; }; 14 | 619CFB7215FCD223002A122D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 619CFB7115FCD223002A122D /* main.m */; }; 15 | 619CFB7615FCD223002A122D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 619CFB7515FCD223002A122D /* AppDelegate.m */; }; 16 | 619CFB7915FCD223002A122D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 619CFB7815FCD223002A122D /* ViewController.m */; }; 17 | 619CFB7C15FCD223002A122D /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 619CFB7A15FCD223002A122D /* ViewController.xib */; }; 18 | 619CFB8B15FCD2CB002A122D /* area.plist in Resources */ = {isa = PBXBuildFile; fileRef = 619CFB8A15FCD2CB002A122D /* area.plist */; }; 19 | 619CFB8E15FCD2FB002A122D /* HZAreaPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 619CFB8D15FCD2FB002A122D /* HZAreaPickerView.m */; }; 20 | 619CFB9115FCD324002A122D /* HZLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 619CFB9015FCD324002A122D /* HZLocation.m */; }; 21 | 619CFB9315FCD693002A122D /* HZAreaPickerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 619CFB9215FCD693002A122D /* HZAreaPickerView.xib */; }; 22 | 619CFB9515FCDA0A002A122D /* city.plist in Resources */ = {isa = PBXBuildFile; fileRef = 619CFB9415FCDA0A002A122D /* city.plist */; }; 23 | 619CFB9C15FCE294002A122D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 619CFB9B15FCE294002A122D /* QuartzCore.framework */; }; 24 | 61C436F61757387A0076F229 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61C436F51757387A0076F229 /* Default-568h@2x.png */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 619CFB6115FCD223002A122D /* areapicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = areapicker.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 619CFB6515FCD223002A122D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 30 | 619CFB6715FCD223002A122D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 31 | 619CFB6915FCD223002A122D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 32 | 619CFB6D15FCD223002A122D /* areapicker-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "areapicker-Info.plist"; sourceTree = ""; }; 33 | 619CFB6F15FCD223002A122D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 34 | 619CFB7115FCD223002A122D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 619CFB7315FCD223002A122D /* areapicker-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "areapicker-Prefix.pch"; sourceTree = ""; }; 36 | 619CFB7415FCD223002A122D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 37 | 619CFB7515FCD223002A122D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 38 | 619CFB7715FCD223002A122D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 39 | 619CFB7815FCD223002A122D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 40 | 619CFB7B15FCD223002A122D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = ""; }; 41 | 619CFB8A15FCD2CB002A122D /* area.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = area.plist; sourceTree = ""; }; 42 | 619CFB8C15FCD2FB002A122D /* HZAreaPickerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HZAreaPickerView.h; sourceTree = ""; }; 43 | 619CFB8D15FCD2FB002A122D /* HZAreaPickerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZAreaPickerView.m; sourceTree = ""; }; 44 | 619CFB8F15FCD324002A122D /* HZLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HZLocation.h; sourceTree = ""; }; 45 | 619CFB9015FCD324002A122D /* HZLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZLocation.m; sourceTree = ""; }; 46 | 619CFB9215FCD693002A122D /* HZAreaPickerView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HZAreaPickerView.xib; sourceTree = ""; }; 47 | 619CFB9415FCDA0A002A122D /* city.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = city.plist; sourceTree = ""; }; 48 | 619CFB9B15FCE294002A122D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 49 | 61C436F51757387A0076F229 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 619CFB5E15FCD223002A122D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 619CFB9C15FCE294002A122D /* QuartzCore.framework in Frameworks */, 58 | 619CFB6615FCD223002A122D /* UIKit.framework in Frameworks */, 59 | 619CFB6815FCD223002A122D /* Foundation.framework in Frameworks */, 60 | 619CFB6A15FCD223002A122D /* CoreGraphics.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 619CFB5615FCD223002A122D = { 68 | isa = PBXGroup; 69 | children = ( 70 | 61C436F51757387A0076F229 /* Default-568h@2x.png */, 71 | 619CFB6B15FCD223002A122D /* areapicker */, 72 | 619CFB6415FCD223002A122D /* Frameworks */, 73 | 619CFB6215FCD223002A122D /* Products */, 74 | ); 75 | sourceTree = ""; 76 | }; 77 | 619CFB6215FCD223002A122D /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 619CFB6115FCD223002A122D /* areapicker.app */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | 619CFB6415FCD223002A122D /* Frameworks */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 619CFB9B15FCE294002A122D /* QuartzCore.framework */, 89 | 619CFB6515FCD223002A122D /* UIKit.framework */, 90 | 619CFB6715FCD223002A122D /* Foundation.framework */, 91 | 619CFB6915FCD223002A122D /* CoreGraphics.framework */, 92 | ); 93 | name = Frameworks; 94 | sourceTree = ""; 95 | }; 96 | 619CFB6B15FCD223002A122D /* areapicker */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 619CFB8615FCD268002A122D /* area picker */, 100 | 619CFB7415FCD223002A122D /* AppDelegate.h */, 101 | 619CFB7515FCD223002A122D /* AppDelegate.m */, 102 | 619CFB7715FCD223002A122D /* ViewController.h */, 103 | 619CFB7815FCD223002A122D /* ViewController.m */, 104 | 619CFB7A15FCD223002A122D /* ViewController.xib */, 105 | 619CFB6C15FCD223002A122D /* Supporting Files */, 106 | ); 107 | path = areapicker; 108 | sourceTree = ""; 109 | }; 110 | 619CFB6C15FCD223002A122D /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 619CFB6D15FCD223002A122D /* areapicker-Info.plist */, 114 | 619CFB6E15FCD223002A122D /* InfoPlist.strings */, 115 | 619CFB7115FCD223002A122D /* main.m */, 116 | 619CFB7315FCD223002A122D /* areapicker-Prefix.pch */, 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | 619CFB8615FCD268002A122D /* area picker */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 619CFB9415FCDA0A002A122D /* city.plist */, 125 | 619CFB8A15FCD2CB002A122D /* area.plist */, 126 | 619CFB8C15FCD2FB002A122D /* HZAreaPickerView.h */, 127 | 619CFB8D15FCD2FB002A122D /* HZAreaPickerView.m */, 128 | 619CFB9215FCD693002A122D /* HZAreaPickerView.xib */, 129 | 619CFB8F15FCD324002A122D /* HZLocation.h */, 130 | 619CFB9015FCD324002A122D /* HZLocation.m */, 131 | ); 132 | name = "area picker"; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | 619CFB6015FCD223002A122D /* areapicker */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 619CFB7F15FCD223002A122D /* Build configuration list for PBXNativeTarget "areapicker" */; 141 | buildPhases = ( 142 | 619CFB5D15FCD223002A122D /* Sources */, 143 | 619CFB5E15FCD223002A122D /* Frameworks */, 144 | 619CFB5F15FCD223002A122D /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = areapicker; 151 | productName = areapicker; 152 | productReference = 619CFB6115FCD223002A122D /* areapicker.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | /* End PBXNativeTarget section */ 156 | 157 | /* Begin PBXProject section */ 158 | 619CFB5815FCD223002A122D /* Project object */ = { 159 | isa = PBXProject; 160 | attributes = { 161 | LastUpgradeCheck = 0460; 162 | ORGANIZATIONNAME = clouddai.com; 163 | }; 164 | buildConfigurationList = 619CFB5B15FCD223002A122D /* Build configuration list for PBXProject "areapicker" */; 165 | compatibilityVersion = "Xcode 3.2"; 166 | developmentRegion = English; 167 | hasScannedForEncodings = 0; 168 | knownRegions = ( 169 | en, 170 | ); 171 | mainGroup = 619CFB5615FCD223002A122D; 172 | productRefGroup = 619CFB6215FCD223002A122D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 619CFB6015FCD223002A122D /* areapicker */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 619CFB5F15FCD223002A122D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 619CFB7015FCD223002A122D /* InfoPlist.strings in Resources */, 187 | 619CFB7C15FCD223002A122D /* ViewController.xib in Resources */, 188 | 619CFB8B15FCD2CB002A122D /* area.plist in Resources */, 189 | 619CFB9315FCD693002A122D /* HZAreaPickerView.xib in Resources */, 190 | 619CFB9515FCDA0A002A122D /* city.plist in Resources */, 191 | 61C436F61757387A0076F229 /* Default-568h@2x.png in Resources */, 192 | ); 193 | runOnlyForDeploymentPostprocessing = 0; 194 | }; 195 | /* End PBXResourcesBuildPhase section */ 196 | 197 | /* Begin PBXSourcesBuildPhase section */ 198 | 619CFB5D15FCD223002A122D /* Sources */ = { 199 | isa = PBXSourcesBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | 619CFB7215FCD223002A122D /* main.m in Sources */, 203 | 619CFB7615FCD223002A122D /* AppDelegate.m in Sources */, 204 | 619CFB7915FCD223002A122D /* ViewController.m in Sources */, 205 | 619CFB8E15FCD2FB002A122D /* HZAreaPickerView.m in Sources */, 206 | 619CFB9115FCD324002A122D /* HZLocation.m in Sources */, 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | /* End PBXSourcesBuildPhase section */ 211 | 212 | /* Begin PBXVariantGroup section */ 213 | 619CFB6E15FCD223002A122D /* InfoPlist.strings */ = { 214 | isa = PBXVariantGroup; 215 | children = ( 216 | 619CFB6F15FCD223002A122D /* en */, 217 | ); 218 | name = InfoPlist.strings; 219 | sourceTree = ""; 220 | }; 221 | 619CFB7A15FCD223002A122D /* ViewController.xib */ = { 222 | isa = PBXVariantGroup; 223 | children = ( 224 | 619CFB7B15FCD223002A122D /* en */, 225 | ); 226 | name = ViewController.xib; 227 | sourceTree = ""; 228 | }; 229 | /* End PBXVariantGroup section */ 230 | 231 | /* Begin XCBuildConfiguration section */ 232 | 619CFB7D15FCD223002A122D /* Debug */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 237 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 238 | CLANG_WARN_CONSTANT_CONVERSION = YES; 239 | CLANG_WARN_ENUM_CONVERSION = YES; 240 | CLANG_WARN_INT_CONVERSION = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 243 | COPY_PHASE_STRIP = NO; 244 | GCC_C_LANGUAGE_STANDARD = gnu99; 245 | GCC_DYNAMIC_NO_PIC = NO; 246 | GCC_OPTIMIZATION_LEVEL = 0; 247 | GCC_PREPROCESSOR_DEFINITIONS = ( 248 | "DEBUG=1", 249 | "$(inherited)", 250 | ); 251 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 252 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 254 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 255 | GCC_WARN_UNUSED_VARIABLE = YES; 256 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 257 | SDKROOT = iphoneos; 258 | }; 259 | name = Debug; 260 | }; 261 | 619CFB7E15FCD223002A122D /* Release */ = { 262 | isa = XCBuildConfiguration; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_ENUM_CONVERSION = YES; 269 | CLANG_WARN_INT_CONVERSION = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 272 | COPY_PHASE_STRIP = YES; 273 | GCC_C_LANGUAGE_STANDARD = gnu99; 274 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 279 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 280 | SDKROOT = iphoneos; 281 | VALIDATE_PRODUCT = YES; 282 | }; 283 | name = Release; 284 | }; 285 | 619CFB8015FCD223002A122D /* Debug */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 289 | GCC_PREFIX_HEADER = "areapicker/areapicker-Prefix.pch"; 290 | INFOPLIST_FILE = "areapicker/areapicker-Info.plist"; 291 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 292 | PRODUCT_NAME = "$(TARGET_NAME)"; 293 | WRAPPER_EXTENSION = app; 294 | }; 295 | name = Debug; 296 | }; 297 | 619CFB8115FCD223002A122D /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 301 | GCC_PREFIX_HEADER = "areapicker/areapicker-Prefix.pch"; 302 | INFOPLIST_FILE = "areapicker/areapicker-Info.plist"; 303 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | WRAPPER_EXTENSION = app; 306 | }; 307 | name = Release; 308 | }; 309 | /* End XCBuildConfiguration section */ 310 | 311 | /* Begin XCConfigurationList section */ 312 | 619CFB5B15FCD223002A122D /* Build configuration list for PBXProject "areapicker" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | 619CFB7D15FCD223002A122D /* Debug */, 316 | 619CFB7E15FCD223002A122D /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | 619CFB7F15FCD223002A122D /* Build configuration list for PBXNativeTarget "areapicker" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | 619CFB8015FCD223002A122D /* Debug */, 325 | 619CFB8115FCD223002A122D /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | defaultConfigurationName = Release; 329 | }; 330 | /* End XCConfigurationList section */ 331 | }; 332 | rootObject = 619CFB5815FCD223002A122D /* Project object */; 333 | } 334 | -------------------------------------------------------------------------------- /areapicker/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /areapicker/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (void)dealloc 16 | { 17 | [_window release]; 18 | [_viewController release]; 19 | [super dealloc]; 20 | } 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 23 | { 24 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 25 | // Override point for customization after application launch. 26 | self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; 27 | self.window.rootViewController = self.viewController; 28 | [self.window makeKeyAndVisible]; 29 | return YES; 30 | } 31 | 32 | - (void)applicationWillResignActive:(UIApplication *)application 33 | { 34 | // 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. 35 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | // 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. 41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | } 43 | 44 | - (void)applicationWillEnterForeground:(UIApplication *)application 45 | { 46 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 47 | } 48 | 49 | - (void)applicationDidBecomeActive:(UIApplication *)application 50 | { 51 | // 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. 52 | } 53 | 54 | - (void)applicationWillTerminate:(UIApplication *)application 55 | { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /areapicker/HZAreaPickerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZAreaPickerView.h 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HZLocation.h" 11 | 12 | typedef enum { 13 | HZAreaPickerWithStateAndCity, 14 | HZAreaPickerWithStateAndCityAndDistrict 15 | } HZAreaPickerStyle; 16 | 17 | @class HZAreaPickerView; 18 | 19 | @protocol HZAreaPickerDatasource 20 | 21 | - (NSArray *)areaPickerData:(HZAreaPickerView *)picker; 22 | 23 | @end 24 | 25 | @protocol HZAreaPickerDelegate 26 | 27 | @optional 28 | - (void)pickerDidChaneStatus:(HZAreaPickerView *)picker; 29 | 30 | @end 31 | 32 | @interface HZAreaPickerView : UIView 33 | 34 | @property (assign, nonatomic) id delegate; 35 | @property (assign, nonatomic) id datasource; 36 | @property (strong, nonatomic) IBOutlet UIPickerView *locatePicker; 37 | @property (strong, nonatomic) HZLocation *locate; 38 | @property (nonatomic) HZAreaPickerStyle pickerStyle; 39 | 40 | - (id)initWithStyle:(HZAreaPickerStyle)pickerStyle withDelegate:(id )delegate andDatasource:(id )datasource; 41 | - (void)showInView:(UIView *)view; 42 | - (void)cancelPicker; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /areapicker/HZAreaPickerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZAreaPickerView.m 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import "HZAreaPickerView.h" 10 | #import 11 | 12 | #define kDuration 0.3 13 | 14 | @interface HZAreaPickerView () 15 | { 16 | NSArray *provinces, *cities, *areas; 17 | } 18 | 19 | @end 20 | 21 | @implementation HZAreaPickerView 22 | 23 | @synthesize delegate=_delegate; 24 | @synthesize datasource=_datasource; 25 | @synthesize pickerStyle=_pickerStyle; 26 | @synthesize locate=_locate; 27 | 28 | - (void)dealloc 29 | { 30 | self.datasource = nil; 31 | self.delegate = nil; 32 | [_locate release]; 33 | [_locatePicker release]; 34 | [provinces release]; 35 | [super dealloc]; 36 | } 37 | 38 | -(HZLocation *)locate 39 | { 40 | if (_locate == nil) { 41 | _locate = [[HZLocation alloc] init]; 42 | } 43 | 44 | return _locate; 45 | } 46 | 47 | - (id)initWithStyle:(HZAreaPickerStyle)pickerStyle withDelegate:(id )delegate andDatasource:(id )datasource 48 | { 49 | 50 | self = [[[[NSBundle mainBundle] loadNibNamed:@"HZAreaPickerView" owner:self options:nil] objectAtIndex:0] retain]; 51 | if (self) { 52 | self.delegate = delegate; 53 | self.pickerStyle = pickerStyle; 54 | self.datasource = datasource; 55 | self.locatePicker.dataSource = self; 56 | self.locatePicker.delegate = self; 57 | 58 | provinces = [[self.datasource areaPickerData:self] retain]; 59 | cities = [[provinces objectAtIndex:0] objectForKey:@"cities"]; 60 | self.locate.state = [[provinces objectAtIndex:0] objectForKey:@"state"]; 61 | if (self.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 62 | self.locate.city = [[cities objectAtIndex:0] objectForKey:@"city"]; 63 | 64 | areas = [[cities objectAtIndex:0] objectForKey:@"areas"]; 65 | if (areas.count > 0) { 66 | self.locate.district = [areas objectAtIndex:0]; 67 | } else{ 68 | self.locate.district = @""; 69 | } 70 | 71 | } else{ 72 | self.locate.city = [cities objectAtIndex:0]; 73 | } 74 | } 75 | 76 | return self; 77 | 78 | } 79 | 80 | 81 | 82 | #pragma mark - PickerView lifecycle 83 | 84 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 85 | { 86 | if (self.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 87 | return 3; 88 | } else{ 89 | return 2; 90 | } 91 | } 92 | 93 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component 94 | { 95 | switch (component) { 96 | case 0: 97 | return [provinces count]; 98 | break; 99 | case 1: 100 | return [cities count]; 101 | break; 102 | case 2: 103 | if (self.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 104 | return [areas count]; 105 | break; 106 | } 107 | default: 108 | return 0; 109 | break; 110 | } 111 | } 112 | 113 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 114 | { 115 | if (self.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 116 | switch (component) { 117 | case 0: 118 | return [[provinces objectAtIndex:row] objectForKey:@"state"]; 119 | break; 120 | case 1: 121 | return [[cities objectAtIndex:row] objectForKey:@"city"]; 122 | break; 123 | case 2: 124 | if ([areas count] > 0) { 125 | return [areas objectAtIndex:row]; 126 | break; 127 | } 128 | default: 129 | return @""; 130 | break; 131 | } 132 | } else{ 133 | switch (component) { 134 | case 0: 135 | return [[provinces objectAtIndex:row] objectForKey:@"state"]; 136 | break; 137 | case 1: 138 | return [cities objectAtIndex:row]; 139 | break; 140 | default: 141 | return @""; 142 | break; 143 | } 144 | } 145 | } 146 | 147 | - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component 148 | { 149 | if (self.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 150 | switch (component) { 151 | case 0: 152 | cities = [[provinces objectAtIndex:row] objectForKey:@"cities"]; 153 | [self.locatePicker selectRow:0 inComponent:1 animated:YES]; 154 | [self.locatePicker reloadComponent:1]; 155 | 156 | areas = [[cities objectAtIndex:0] objectForKey:@"areas"]; 157 | [self.locatePicker selectRow:0 inComponent:2 animated:YES]; 158 | [self.locatePicker reloadComponent:2]; 159 | 160 | self.locate.state = [[provinces objectAtIndex:row] objectForKey:@"state"]; 161 | self.locate.city = [[cities objectAtIndex:0] objectForKey:@"city"]; 162 | if ([areas count] > 0) { 163 | self.locate.district = [areas objectAtIndex:0]; 164 | } else{ 165 | self.locate.district = @""; 166 | } 167 | break; 168 | case 1: 169 | areas = [[cities objectAtIndex:row] objectForKey:@"areas"]; 170 | [self.locatePicker selectRow:0 inComponent:2 animated:YES]; 171 | [self.locatePicker reloadComponent:2]; 172 | 173 | self.locate.city = [[cities objectAtIndex:row] objectForKey:@"city"]; 174 | if ([areas count] > 0) { 175 | self.locate.district = [areas objectAtIndex:0]; 176 | } else{ 177 | self.locate.district = @""; 178 | } 179 | break; 180 | case 2: 181 | if ([areas count] > 0) { 182 | self.locate.district = [areas objectAtIndex:row]; 183 | } else{ 184 | self.locate.district = @""; 185 | } 186 | break; 187 | default: 188 | break; 189 | } 190 | } else{ 191 | switch (component) { 192 | case 0: 193 | cities = [[provinces objectAtIndex:row] objectForKey:@"cities"]; 194 | [self.locatePicker selectRow:0 inComponent:1 animated:YES]; 195 | [self.locatePicker reloadComponent:1]; 196 | 197 | self.locate.state = [[provinces objectAtIndex:row] objectForKey:@"state"]; 198 | self.locate.city = [cities objectAtIndex:0]; 199 | break; 200 | case 1: 201 | self.locate.city = [cities objectAtIndex:row]; 202 | break; 203 | default: 204 | break; 205 | } 206 | } 207 | 208 | if([self.delegate respondsToSelector:@selector(pickerDidChaneStatus:)]) { 209 | [self.delegate pickerDidChaneStatus:self]; 210 | } 211 | 212 | } 213 | 214 | 215 | #pragma mark - animation 216 | 217 | - (void)showInView:(UIView *) view 218 | { 219 | self.frame = CGRectMake(0, view.frame.size.height, self.frame.size.width, self.frame.size.height); 220 | [view addSubview:self]; 221 | 222 | [UIView animateWithDuration:0.3 animations:^{ 223 | self.frame = CGRectMake(0, view.frame.size.height - self.frame.size.height, self.frame.size.width, self.frame.size.height); 224 | }]; 225 | 226 | } 227 | 228 | - (void)cancelPicker 229 | { 230 | 231 | [UIView animateWithDuration:0.3 232 | animations:^{ 233 | self.frame = CGRectMake(0, self.frame.origin.y+self.frame.size.height, self.frame.size.width, self.frame.size.height); 234 | } 235 | completion:^(BOOL finished){ 236 | [self removeFromSuperview]; 237 | 238 | }]; 239 | 240 | } 241 | 242 | @end 243 | -------------------------------------------------------------------------------- /areapicker/HZAreaPickerView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1296 5 | 12B19 6 | 2549 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1498 12 | 13 | 14 | IBProxyObject 15 | IBUIPickerView 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 290 41 | {320, 216} 42 | 43 | 44 | _NS:9 45 | IBCocoaTouchFramework 46 | YES 47 | 48 | 49 | {320, 216} 50 | 51 | 52 | 53 | 54 | 3 55 | MQA 56 | 57 | 2 58 | 59 | 60 | IBCocoaTouchFramework 61 | 62 | 63 | 64 | 65 | 66 | 67 | locatePicker 68 | 69 | 70 | 71 | 6 72 | 73 | 74 | 75 | dataSource 76 | 77 | 78 | 79 | 4 80 | 81 | 82 | 83 | delegate 84 | 85 | 86 | 87 | 5 88 | 89 | 90 | 91 | 92 | 93 | 0 94 | 95 | 96 | 97 | 98 | 99 | 1 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -1 108 | 109 | 110 | File's Owner 111 | 112 | 113 | -2 114 | 115 | 116 | 117 | 118 | 3 119 | 120 | 121 | 122 | 123 | 124 | 125 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 126 | UIResponder 127 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 128 | HZAreaPickerView 129 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | 132 | 133 | 134 | 135 | 136 | 6 137 | 138 | 139 | 140 | 141 | HZAreaPickerView 142 | UIView 143 | 144 | locatePicker 145 | UIPickerView 146 | 147 | 148 | locatePicker 149 | 150 | locatePicker 151 | UIPickerView 152 | 153 | 154 | 155 | IBProjectSource 156 | ./Classes/HZAreaPickerView.h 157 | 158 | 159 | 160 | 161 | 0 162 | IBCocoaTouchFramework 163 | 164 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 165 | 166 | 167 | YES 168 | 3 169 | 1498 170 | 171 | 172 | -------------------------------------------------------------------------------- /areapicker/HZLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZLocation.h 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HZLocation : NSObject 12 | 13 | @property (copy, nonatomic) NSString *country; 14 | @property (copy, nonatomic) NSString *state; 15 | @property (copy, nonatomic) NSString *city; 16 | @property (copy, nonatomic) NSString *district; 17 | @property (copy, nonatomic) NSString *street; 18 | @property (nonatomic) double latitude; 19 | @property (nonatomic) double longitude; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /areapicker/HZLocation.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZLocation.m 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import "HZLocation.h" 10 | 11 | @implementation HZLocation 12 | 13 | @synthesize country = _country; 14 | @synthesize state = _state; 15 | @synthesize city = _city; 16 | @synthesize district = _district; 17 | @synthesize street = _street; 18 | @synthesize latitude = _latitude; 19 | @synthesize longitude = _longitude; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /areapicker/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /areapicker/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "HZAreaPickerView.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (retain, nonatomic) IBOutlet UITextField *areaText; 15 | @property (retain, nonatomic) IBOutlet UITextField *cityText; 16 | @property (strong, nonatomic) NSString *areaValue, *cityValue; 17 | @property (strong, nonatomic) HZAreaPickerView *locatePicker; 18 | 19 | -(void)cancelLocatePicker; 20 | 21 | @end 22 | 23 | @implementation ViewController 24 | @synthesize areaText; 25 | @synthesize cityText; 26 | @synthesize areaValue=_areaValue, cityValue=_cityValue; 27 | @synthesize locatePicker=_locatePicker; 28 | 29 | - (void)dealloc { 30 | [areaText release]; 31 | [cityText release]; 32 | [_cityValue release]; 33 | [_areaValue release]; 34 | [super dealloc]; 35 | } 36 | 37 | -(void)setAreaValue:(NSString *)areaValue 38 | { 39 | if (![_areaValue isEqualToString:areaValue]) { 40 | _areaValue = [areaValue retain]; 41 | self.areaText.text = areaValue; 42 | } 43 | } 44 | 45 | -(void)setCityValue:(NSString *)cityValue 46 | { 47 | if (![_cityValue isEqualToString:cityValue]) { 48 | _cityValue = [cityValue retain]; 49 | self.cityText.text = cityValue; 50 | } 51 | } 52 | 53 | - (void)viewDidUnload 54 | { 55 | [self setAreaText:nil]; 56 | [self setCityText:nil]; 57 | [self cancelLocatePicker]; 58 | [super viewDidUnload]; 59 | // Release any retained subviews of the main view. 60 | } 61 | 62 | #pragma mark - HZAreaPicker delegate 63 | -(void)pickerDidChaneStatus:(HZAreaPickerView *)picker 64 | { 65 | if (picker.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 66 | self.areaValue = [NSString stringWithFormat:@"%@ %@ %@", picker.locate.state, picker.locate.city, picker.locate.district]; 67 | } else{ 68 | self.cityValue = [NSString stringWithFormat:@"%@ %@", picker.locate.state, picker.locate.city]; 69 | } 70 | } 71 | 72 | -(NSArray *)areaPickerData:(HZAreaPickerView *)picker 73 | { 74 | NSArray *data; 75 | if (picker.pickerStyle == HZAreaPickerWithStateAndCityAndDistrict) { 76 | data = [[[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"area.plist" ofType:nil]] autorelease]; 77 | } else{ 78 | data = [[[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"city.plist" ofType:nil]] autorelease]; 79 | } 80 | return data; 81 | } 82 | 83 | 84 | 85 | -(void)cancelLocatePicker 86 | { 87 | [self.locatePicker cancelPicker]; 88 | self.locatePicker.delegate = nil; 89 | self.locatePicker = nil; 90 | } 91 | 92 | 93 | #pragma mark - TextField delegate 94 | - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField 95 | { 96 | if ([textField isEqual:self.areaText]) { 97 | [self cancelLocatePicker]; 98 | self.locatePicker = [[[HZAreaPickerView alloc] initWithStyle:HZAreaPickerWithStateAndCityAndDistrict 99 | withDelegate:self 100 | andDatasource:self] autorelease]; 101 | [self.locatePicker showInView:self.view]; 102 | } else { 103 | [self cancelLocatePicker]; 104 | self.locatePicker = [[[HZAreaPickerView alloc] initWithStyle:HZAreaPickerWithStateAndCity 105 | withDelegate:self 106 | andDatasource:self] autorelease]; 107 | [self.locatePicker showInView:self.view]; 108 | } 109 | return NO; 110 | } 111 | 112 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 113 | [super touchesBegan:touches withEvent:event]; 114 | [self cancelLocatePicker]; 115 | } 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /areapicker/areapicker-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.clouddai.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /areapicker/areapicker-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'areapicker' target in the 'areapicker' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /areapicker/city.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | cities 7 | 8 | 通州 9 | 房山 10 | 昌平 11 | 顺义 12 | 怀柔 13 | 大兴 14 | 密云 15 | 平谷 16 | 延庆 17 | 东城 18 | 崇文 19 | 西城 20 | 朝阳 21 | 宣武 22 | 石景山 23 | 丰台 24 | 门头沟 25 | 海淀 26 | 27 | state 28 | 北京 29 | 30 | 31 | cities 32 | 33 | 普陀 34 | 闸北 35 | 虹口 36 | 杨浦 37 | 卢湾 38 | 徐汇 39 | 长宁 40 | 静安 41 | 黄浦 42 | 金山 43 | 浦东新 44 | 嘉定 45 | 闵行 46 | 宝山 47 | 南汇 48 | 青浦 49 | 松江 50 | 奉贤 51 | 崇明 52 | 53 | state 54 | 上海 55 | 56 | 57 | cities 58 | 59 | 武清 60 | 河东 61 | 和平 62 | 西青 63 | 津南 64 | 大港 65 | 东丽 66 | 塘沽 67 | 汉沽 68 | 河北 69 | 红桥 70 | 河西 71 | 南开 72 | 蓟县 73 | 宁河 74 | 静海 75 | 宝坻 76 | 北辰 77 | 78 | state 79 | 天津 80 | 81 | 82 | cities 83 | 84 | 开县 85 | 江北 86 | 沙坪坝 87 | 九龙坡 88 | 南岸 89 | 北碚 90 | 万盛 91 | 双桥 92 | 渝北 93 | 巴南 94 | 黔江 95 | 垫江 96 | 武隆 97 | 巫山 98 | 巫溪 99 | 云阳 100 | 奉节 101 | 忠县 102 | 梁平 103 | 璧山 104 | 荣昌 105 | 大足 106 | 铜梁 107 | 潼南 108 | 綦江 109 | 长寿 110 | 彭水 111 | 酉阳 112 | 合川 113 | 江津 114 | 南川 115 | 永川 116 | 丰都 117 | 城口 118 | 大渡口 119 | 渝中 120 | 涪陵 121 | 万州 122 | 石柱 123 | 秀山 124 | 125 | state 126 | 重庆 127 | 128 | 129 | cities 130 | 131 | 丽水 132 | 舟山 133 | 宁波 134 | 衢州 135 | 温州 136 | 杭州 137 | 台州 138 | 嘉兴 139 | 绍兴 140 | 金华 141 | 湖州 142 | 143 | state 144 | 浙江 145 | 146 | 147 | cities 148 | 149 | 珠海 150 | 惠州 151 | 清远 152 | 韶关 153 | 江门 154 | 揭阳 155 | 云浮 156 | 佛山 157 | 广州 158 | 深圳 159 | 河源 160 | 汕头 161 | 汕尾 162 | 茂名 163 | 肇庆 164 | 东莞 165 | 湛江 166 | 潮州 167 | 阳江 168 | 中山 169 | 梅州 170 | 171 | state 172 | 广东 173 | 174 | 175 | cities 176 | 177 | 连云港 178 | 盐城 179 | 无锡 180 | 宿迁 181 | 扬州 182 | 镇江 183 | 南京 184 | 徐州 185 | 泰州 186 | 南通 187 | 常州 188 | 淮安 189 | 苏州 190 | 191 | state 192 | 江苏 193 | 194 | 195 | cities 196 | 197 | 淄博 198 | 烟台 199 | 日照 200 | 荷泽 201 | 潍坊 202 | 济南 203 | 济宁 204 | 青岛 205 | 临沂 206 | 威海 207 | 莱芜 208 | 泰安 209 | 东营 210 | 聊城 211 | 枣庄 212 | 滨州 213 | 德州 214 | 215 | state 216 | 山东 217 | 218 | 219 | cities 220 | 221 | 南平 222 | 厦门 223 | 福州 224 | 宁德 225 | 龙岩 226 | 莆田 227 | 漳州 228 | 泉州 229 | 三明 230 | 231 | state 232 | 福建 233 | 234 | 235 | cities 236 | 237 | 淮南 238 | 黄山 239 | 蚌埠 240 | 合肥 241 | 宿州 242 | 六安 243 | 池州 244 | 芜湖 245 | 宣城 246 | 巢湖 247 | 亳州 248 | 阜阳 249 | 铜陵 250 | 淮北 251 | 滁州 252 | 马鞍山 253 | 安庆 254 | 255 | state 256 | 安徽 257 | 258 | 259 | cities 260 | 261 | 宜宾 262 | 巴中 263 | 南充 264 | 成都 265 | 凉山彝族 266 | 眉山 267 | 阿坝 268 | 乐山 269 | 绵阳 270 | 广安 271 | 广元 272 | 德阳 273 | 资阳 274 | 达州 275 | 泸州 276 | 自贡 277 | 遂宁 278 | 甘孜藏族 279 | 雅安 280 | 内江 281 | 攀枝花 282 | 283 | state 284 | 四川 285 | 286 | 287 | cities 288 | 289 | 咸宁 290 | 宜昌 291 | 黄冈 292 | 荆州 293 | 孝感 294 | 荆门 295 | 十堰 296 | 鄂州 297 | 天门 298 | 潜江 299 | 恩施 300 | 武汉 301 | 仙桃 302 | 神农架林 303 | 随州 304 | 黄石 305 | 襄樊 306 | 307 | state 308 | 湖北 309 | 310 | 311 | cities 312 | 313 | 张家口 314 | 邯郸 315 | 邢台 316 | 衡水 317 | 秦皇岛 318 | 廊坊 319 | 保定 320 | 承德 321 | 唐山 322 | 沧州 323 | 石家庄 324 | 325 | state 326 | 河北 327 | 328 | 329 | cities 330 | 331 | 德宏 332 | 玉溪 333 | 曲靖 334 | 保山 335 | 怒江 336 | 迪庆 337 | 昭通 338 | 昆明 339 | 楚雄 340 | 文山 341 | 西双版纳 342 | 丽江 343 | 红河 344 | 大理 345 | 临沧 346 | 思茅 347 | 348 | state 349 | 云南 350 | 351 | 352 | cities 353 | 354 | 鹤岗 355 | 大兴安岭地 356 | 大庆 357 | 七台河 358 | 齐齐哈尔 359 | 牡丹江 360 | 黑河 361 | 双鸭山 362 | 绥化 363 | 伊春 364 | 佳木斯 365 | 哈尔滨 366 | 鸡西 367 | 368 | state 369 | 黑龙江 370 | 371 | 372 | cities 373 | 374 | 松原 375 | 四平 376 | 白城 377 | 白山 378 | 吉林 379 | 通化 380 | 长春 381 | 延边朝鲜族 382 | 辽源 383 | 384 | state 385 | 吉林 386 | 387 | 388 | cities 389 | 390 | 铁岭 391 | 葫芦岛 392 | 营口 393 | 本溪 394 | 辽阳 395 | 盘锦 396 | 阜新 397 | 朝阳 398 | 锦州 399 | 抚顺 400 | 丹东 401 | 沈阳 402 | 鞍山 403 | 大连 404 | 405 | state 406 | 辽宁 407 | 408 | 409 | cities 410 | 411 | 保亭 412 | 澄迈 413 | 南沙群岛 414 | 陵水黎族 415 | 中沙群岛 416 | 屯昌 417 | 昌江黎族 418 | 乐东黎族 419 | 琼海 420 | 儋州 421 | 文昌 422 | 万宁 423 | 白沙黎族 424 | 海口 425 | 三亚 426 | 五指山 427 | 琼中 428 | 东方 429 | 定安 430 | 西沙群岛 431 | 临高 432 | 433 | state 434 | 海南 435 | 436 | 437 | cities 438 | 439 | 郴州 440 | 岳阳 441 | 怀化 442 | 娄底 443 | 张家界 444 | 益阳 445 | 湘西土家族苗族 446 | 常德 447 | 湘潭 448 | 永州 449 | 衡阳 450 | 株洲 451 | 长沙 452 | 邵阳 453 | 454 | state 455 | 湖南 456 | 457 | 458 | cities 459 | 460 | 南阳 461 | 洛阳 462 | 三门峡 463 | 商丘 464 | 焦作 465 | 开封 466 | 驻马店 467 | 濮阳 468 | 许昌 469 | 安阳 470 | 信阳 471 | 漯河 472 | 平顶山 473 | 郑州 474 | 新乡 475 | 鹤壁 476 | 周口 477 | 478 | state 479 | 河南 480 | 481 | 482 | cities 483 | 484 | 毕节地 485 | 黔南 486 | 六盘水 487 | 黔东南 488 | 贵阳 489 | 遵义 490 | 铜仁地 491 | 黔西南 492 | 安顺 493 | 494 | state 495 | 贵州 496 | 497 | 498 | cities 499 | 500 | 南昌 501 | 萍乡 502 | 景德镇 503 | 吉安 504 | 九江 505 | 新余 506 | 鹰潭 507 | 抚州 508 | 赣州 509 | 上饶 510 | 宜春 511 | 512 | state 513 | 江西 514 | 515 | 516 | cities 517 | 518 | 贺州 519 | 梧州 520 | 河池 521 | 百色 522 | 来宾 523 | 贵港 524 | 玉林 525 | 钦州 526 | 北海 527 | 柳州 528 | 桂林 529 | 南宁 530 | 防城港 531 | 崇左 532 | 533 | state 534 | 广西 535 | 536 | 537 | cities 538 | 539 | 咸阳 540 | 铜川 541 | 商洛 542 | 榆林 543 | 渭南 544 | 汉中 545 | 安康 546 | 延安 547 | 宝鸡 548 | 西安 549 | 550 | state 551 | 陕西 552 | 553 | 554 | cities 555 | 556 | 临汾 557 | 晋中 558 | 朔州 559 | 运城 560 | 晋城 561 | 阳泉 562 | 忻州 563 | 大同 564 | 长治 565 | 太原 566 | 吕梁 567 | 568 | state 569 | 山西 570 | 571 | 572 | cities 573 | 574 | 黄南 575 | 海东地 576 | 果洛 577 | 西宁 578 | 海北 579 | 玉树 580 | 海南 581 | 海西 582 | 583 | state 584 | 青海 585 | 586 | 587 | cities 588 | 589 | 石嘴山 590 | 固原 591 | 中卫 592 | 银川 593 | 吴忠 594 | 595 | state 596 | 宁夏 597 | 598 | 599 | cities 600 | 601 | 兰州 602 | 金昌 603 | 甘南藏族 604 | 平凉 605 | 嘉峪关 606 | 天水 607 | 白银 608 | 武威 609 | 张掖 610 | 庆阳 611 | 定西 612 | 临夏回族 613 | 酒泉 614 | 陇南 615 | 616 | state 617 | 甘肃 618 | 619 | 620 | cities 621 | 622 | 阿里地 623 | 拉萨 624 | 山南地 625 | 日喀则地 626 | 那曲地 627 | 昌都地 628 | 林芝地 629 | 630 | state 631 | 西藏 632 | 633 | 634 | cities 635 | 636 | 巴彦淖尔 637 | 锡林郭勒盟 638 | 兴安盟 639 | 乌兰察布 640 | 鄂尔多斯 641 | 乌海 642 | 包头 643 | 呼和浩特 644 | 呼伦贝尔 645 | 通辽 646 | 阿拉善盟 647 | 赤峰 648 | 649 | state 650 | 内蒙古 651 | 652 | 653 | cities 654 | 655 | 伊犁 656 | 克拉玛依 657 | 哈密地 658 | 石河子 659 | 吐鲁番地 660 | 阿拉尔 661 | 阿勒泰地 662 | 乌鲁木齐 663 | 塔城地 664 | 昌吉 665 | 克孜勒 666 | 图木舒克 667 | 阿克苏地 668 | 五家渠 669 | 巴音郭楞 670 | 和田地 671 | 博尔塔拉 672 | 喀什地 673 | 674 | state 675 | 新疆 676 | 677 | 678 | cities 679 | 680 | 新竹 681 | 基隆 682 | 高雄 683 | 台北 684 | 台南 685 | 嘉义 686 | 台中 687 | 宜兰 688 | 屏东 689 | 桃园 690 | 台东 691 | 苗栗 692 | 金门 693 | 花莲 694 | 云林 695 | 连江 696 | 澎湖 697 | 南投 698 | 彰化 699 | 700 | state 701 | 台湾 702 | 703 | 704 | cities 705 | 706 | 油尖旺 707 | 黄大仙 708 | 深水埗 709 | 观塘 710 | 九龙城 711 | 湾仔 712 | 葵青 713 | 离岛 714 | 中西 715 | 716 | 717 | 荃湾 718 | 元朗 719 | 沙田 720 | 西贡 721 | 屯门 722 | 大埔 723 | 724 | 725 | state 726 | 香港 727 | 728 | 729 | cities 730 | 731 | 花地玛堂 732 | 圣安多尼堂 733 | 大堂 734 | 望德堂 735 | 风顺堂 736 | 嘉模堂 737 | 圣方济各堂 738 | 739 | state 740 | 澳门 741 | 742 | 743 | cities 744 | 745 | 德国 746 | 新加坡 747 | 美国 748 | 加拿大 749 | 澳大利亚 750 | 日本 751 | 英国 752 | 巴西 753 | 俄罗斯 754 | 尼日利亚 755 | 马来西亚 756 | 爱尔兰 757 | 奥地利 758 | 挪威 759 | 意大利 760 | 西班牙 761 | 泰国 762 | 芬兰 763 | 丹麦 764 | 荷兰 765 | 阿联酋 766 | 瑞典 767 | 瑞士 768 | 比利时 769 | 新西兰 770 | 法国 771 | 韩国 772 | 匈牙利 773 | 其他 774 | 越南 775 | 以色列 776 | 科威特 777 | 希腊 778 | 南非 779 | 葡萄牙 780 | 墨西哥 781 | 印尼 782 | 783 | state 784 | 国外 785 | 786 | 787 | 788 | -------------------------------------------------------------------------------- /areapicker/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /areapicker/en.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1296 5 | 12B19 6 | 2549 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1498 12 | 13 | 14 | IBProxyObject 15 | IBUILabel 16 | IBUITextField 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 292 42 | {{87, 60}, {180, 31}} 43 | 44 | 45 | _NS:9 46 | NO 47 | YES 48 | IBCocoaTouchFramework 49 | 0 50 | 51 | 3 52 | 53 | 3 54 | MAA 55 | 56 | 2 57 | 58 | 59 | YES 60 | 17 61 | 62 | IBCocoaTouchFramework 63 | 64 | 65 | 1 66 | 14 67 | 68 | 69 | Helvetica 70 | 14 71 | 16 72 | 73 | 74 | 75 | 76 | 292 77 | {{37, 63}, {42, 21}} 78 | 79 | 80 | _NS:9 81 | NO 82 | YES 83 | 7 84 | NO 85 | IBCocoaTouchFramework 86 | 城市 87 | 88 | 1 89 | MCAwIDAAA 90 | 91 | 92 | 0 93 | 10 94 | 95 | 1 96 | 17 97 | 98 | 99 | Helvetica 100 | 17 101 | 16 102 | 103 | 104 | 105 | 106 | 292 107 | {{87, 127}, {180, 31}} 108 | 109 | _NS:9 110 | NO 111 | YES 112 | IBCocoaTouchFramework 113 | 0 114 | 115 | 3 116 | 117 | 3 118 | MAA 119 | 120 | 121 | YES 122 | 17 123 | 124 | IBCocoaTouchFramework 125 | 126 | 127 | 128 | 129 | 130 | 131 | 292 132 | {{37, 129}, {42, 21}} 133 | 134 | 135 | _NS:9 136 | NO 137 | YES 138 | 7 139 | NO 140 | IBCocoaTouchFramework 141 | 区域 142 | 143 | 144 | 0 145 | 10 146 | 147 | 148 | 149 | 150 | {{0, 20}, {320, 460}} 151 | 152 | 153 | 154 | 3 155 | MC43NQA 156 | 157 | 158 | NO 159 | 160 | IBCocoaTouchFramework 161 | 162 | 163 | 164 | 165 | 166 | 167 | view 168 | 169 | 170 | 171 | 7 172 | 173 | 174 | 175 | areaText 176 | 177 | 178 | 179 | 12 180 | 181 | 182 | 183 | cityText 184 | 185 | 186 | 187 | 13 188 | 189 | 190 | 191 | delegate 192 | 193 | 194 | 195 | 14 196 | 197 | 198 | 199 | delegate 200 | 201 | 202 | 203 | 15 204 | 205 | 206 | 207 | 208 | 209 | 0 210 | 211 | 212 | 213 | 214 | 215 | -1 216 | 217 | 218 | File's Owner 219 | 220 | 221 | -2 222 | 223 | 224 | 225 | 226 | 6 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 8 238 | 239 | 240 | 241 | 242 | 9 243 | 244 | 245 | 246 | 247 | 10 248 | 249 | 250 | 251 | 252 | 11 253 | 254 | 255 | 256 | 257 | 258 | 259 | ViewController 260 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 261 | UIResponder 262 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 263 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 264 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 265 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 266 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 267 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 268 | 269 | 270 | 271 | 272 | 273 | 15 274 | 275 | 276 | 0 277 | IBCocoaTouchFramework 278 | 279 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 280 | 281 | 282 | YES 283 | 3 284 | 1498 285 | 286 | 287 | -------------------------------------------------------------------------------- /areapicker/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // areapicker 4 | // 5 | // Created by Cloud Dai on 12-9-9. 6 | // Copyright (c) 2012年 clouddai.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | --------------------------------------------------------------------------------