├── Demo ├── Demo.xcodeproj │ └── project.pbxproj ├── Demo │ ├── Demo-Info.plist │ ├── Demo-Prefix.pch │ ├── DemoAppDelegate.h │ ├── DemoAppDelegate.m │ ├── DemoViewController.h │ ├── DemoViewController.m │ ├── en.lproj │ │ ├── DemoViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ └── main.m └── XMLReaderTests │ ├── XMLReaderTests-Info.plist │ ├── XMLReaderTests-Prefix.pch │ ├── XMLReaderTests.h │ ├── XMLReaderTests.m │ ├── complex.xml │ └── en.lproj │ └── InfoPlist.strings ├── LICENCE ├── README ├── XMLReader.h └── XMLReader.m /Demo/Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | ED2F618B137570CF001A1ABA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2F618A137570CF001A1ABA /* UIKit.framework */; }; 11 | ED2F618D137570CF001A1ABA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2F618C137570CF001A1ABA /* Foundation.framework */; }; 12 | ED2F618F137570CF001A1ABA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2F618E137570CF001A1ABA /* CoreGraphics.framework */; }; 13 | ED2F6195137570CF001A1ABA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ED2F6193137570CF001A1ABA /* InfoPlist.strings */; }; 14 | ED2F6198137570CF001A1ABA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ED2F6197137570CF001A1ABA /* main.m */; }; 15 | ED2F619B137570CF001A1ABA /* DemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ED2F619A137570CF001A1ABA /* DemoAppDelegate.m */; }; 16 | ED2F619E137570CF001A1ABA /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = ED2F619C137570CF001A1ABA /* MainWindow.xib */; }; 17 | ED2F61A1137570CF001A1ABA /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED2F61A0137570CF001A1ABA /* DemoViewController.m */; }; 18 | ED2F61A4137570CF001A1ABA /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ED2F61A2137570CF001A1ABA /* DemoViewController.xib */; }; 19 | ED2F61AB137570CF001A1ABA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2F618A137570CF001A1ABA /* UIKit.framework */; }; 20 | ED2F61AC137570CF001A1ABA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2F618C137570CF001A1ABA /* Foundation.framework */; }; 21 | ED2F61AD137570CF001A1ABA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2F618E137570CF001A1ABA /* CoreGraphics.framework */; }; 22 | ED2F61D2137572AF001A1ABA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ED2F61CC137572AF001A1ABA /* InfoPlist.strings */; }; 23 | ED2F61D4137572AF001A1ABA /* XMLReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = ED2F61D1137572AF001A1ABA /* XMLReaderTests.m */; }; 24 | ED2F61D81375734B001A1ABA /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = ED2F61D71375734B001A1ABA /* XMLReader.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | ED2F61AE137570CF001A1ABA /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = ED2F617D137570CF001A1ABA /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = ED2F6185137570CF001A1ABA; 33 | remoteInfo = Demo; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | ED2F6186137570CF001A1ABA /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | ED2F618A137570CF001A1ABA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 40 | ED2F618C137570CF001A1ABA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | ED2F618E137570CF001A1ABA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | ED2F6192137570CF001A1ABA /* Demo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Demo-Info.plist"; sourceTree = ""; }; 43 | ED2F6194137570CF001A1ABA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | ED2F6196137570CF001A1ABA /* Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Demo-Prefix.pch"; sourceTree = ""; }; 45 | ED2F6197137570CF001A1ABA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | ED2F6199137570CF001A1ABA /* DemoAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoAppDelegate.h; sourceTree = ""; }; 47 | ED2F619A137570CF001A1ABA /* DemoAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoAppDelegate.m; sourceTree = ""; }; 48 | ED2F619D137570CF001A1ABA /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 49 | ED2F619F137570CF001A1ABA /* DemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoViewController.h; sourceTree = ""; }; 50 | ED2F61A0137570CF001A1ABA /* DemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoViewController.m; sourceTree = ""; }; 51 | ED2F61A3137570CF001A1ABA /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DemoViewController.xib; sourceTree = ""; }; 52 | ED2F61AA137570CF001A1ABA /* XMLReaderTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XMLReaderTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | ED2F61CD137572AF001A1ABA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = XMLReaderTests/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; 54 | ED2F61CE137572AF001A1ABA /* XMLReaderTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "XMLReaderTests-Info.plist"; path = "XMLReaderTests/XMLReaderTests-Info.plist"; sourceTree = SOURCE_ROOT; }; 55 | ED2F61CF137572AF001A1ABA /* XMLReaderTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "XMLReaderTests-Prefix.pch"; path = "XMLReaderTests/XMLReaderTests-Prefix.pch"; sourceTree = SOURCE_ROOT; }; 56 | ED2F61D0137572AF001A1ABA /* XMLReaderTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLReaderTests.h; path = XMLReaderTests/XMLReaderTests.h; sourceTree = SOURCE_ROOT; }; 57 | ED2F61D1137572AF001A1ABA /* XMLReaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMLReaderTests.m; path = XMLReaderTests/XMLReaderTests.m; sourceTree = SOURCE_ROOT; }; 58 | ED2F61D61375734B001A1ABA /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLReader.h; path = ../XMLReader.h; sourceTree = ""; }; 59 | ED2F61D71375734B001A1ABA /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMLReader.m; path = ../XMLReader.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | ED2F6183137570CF001A1ABA /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ED2F618B137570CF001A1ABA /* UIKit.framework in Frameworks */, 68 | ED2F618D137570CF001A1ABA /* Foundation.framework in Frameworks */, 69 | ED2F618F137570CF001A1ABA /* CoreGraphics.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | ED2F61A6137570CF001A1ABA /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ED2F61AB137570CF001A1ABA /* UIKit.framework in Frameworks */, 78 | ED2F61AC137570CF001A1ABA /* Foundation.framework in Frameworks */, 79 | ED2F61AD137570CF001A1ABA /* CoreGraphics.framework in Frameworks */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | ED2F617B137570CF001A1ABA = { 87 | isa = PBXGroup; 88 | children = ( 89 | ED2F61D513757334001A1ABA /* XMLReader */, 90 | ED2F61B0137570CF001A1ABA /* XMLReaderTests */, 91 | ED2F6190137570CF001A1ABA /* Demo */, 92 | ED2F6189137570CF001A1ABA /* Frameworks */, 93 | ED2F6187137570CF001A1ABA /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | ED2F6187137570CF001A1ABA /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | ED2F6186137570CF001A1ABA /* Demo.app */, 101 | ED2F61AA137570CF001A1ABA /* XMLReaderTests.octest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | ED2F6189137570CF001A1ABA /* Frameworks */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | ED2F618A137570CF001A1ABA /* UIKit.framework */, 110 | ED2F618C137570CF001A1ABA /* Foundation.framework */, 111 | ED2F618E137570CF001A1ABA /* CoreGraphics.framework */, 112 | ); 113 | name = Frameworks; 114 | sourceTree = ""; 115 | }; 116 | ED2F6190137570CF001A1ABA /* Demo */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | ED2F6199137570CF001A1ABA /* DemoAppDelegate.h */, 120 | ED2F619A137570CF001A1ABA /* DemoAppDelegate.m */, 121 | ED2F619F137570CF001A1ABA /* DemoViewController.h */, 122 | ED2F61A0137570CF001A1ABA /* DemoViewController.m */, 123 | ED2F6191137570CF001A1ABA /* Supporting Files */, 124 | ); 125 | path = Demo; 126 | sourceTree = ""; 127 | }; 128 | ED2F6191137570CF001A1ABA /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | ED2F61D913757371001A1ABA /* XIB */, 132 | ED2F6192137570CF001A1ABA /* Demo-Info.plist */, 133 | ED2F6193137570CF001A1ABA /* InfoPlist.strings */, 134 | ED2F6196137570CF001A1ABA /* Demo-Prefix.pch */, 135 | ED2F6197137570CF001A1ABA /* main.m */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | ED2F61B0137570CF001A1ABA /* XMLReaderTests */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | ED2F61D0137572AF001A1ABA /* XMLReaderTests.h */, 144 | ED2F61D1137572AF001A1ABA /* XMLReaderTests.m */, 145 | ED2F61B1137570CF001A1ABA /* Supporting Files */, 146 | ); 147 | name = XMLReaderTests; 148 | path = DemoTests; 149 | sourceTree = ""; 150 | }; 151 | ED2F61B1137570CF001A1ABA /* Supporting Files */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | ED2F61CC137572AF001A1ABA /* InfoPlist.strings */, 155 | ED2F61CE137572AF001A1ABA /* XMLReaderTests-Info.plist */, 156 | ED2F61CF137572AF001A1ABA /* XMLReaderTests-Prefix.pch */, 157 | ); 158 | name = "Supporting Files"; 159 | sourceTree = ""; 160 | }; 161 | ED2F61D513757334001A1ABA /* XMLReader */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | ED2F61D61375734B001A1ABA /* XMLReader.h */, 165 | ED2F61D71375734B001A1ABA /* XMLReader.m */, 166 | ); 167 | name = XMLReader; 168 | sourceTree = ""; 169 | }; 170 | ED2F61D913757371001A1ABA /* XIB */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | ED2F61A2137570CF001A1ABA /* DemoViewController.xib */, 174 | ED2F619C137570CF001A1ABA /* MainWindow.xib */, 175 | ); 176 | name = XIB; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXGroup section */ 180 | 181 | /* Begin PBXNativeTarget section */ 182 | ED2F6185137570CF001A1ABA /* Demo */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = ED2F61BD137570CF001A1ABA /* Build configuration list for PBXNativeTarget "Demo" */; 185 | buildPhases = ( 186 | ED2F6182137570CF001A1ABA /* Sources */, 187 | ED2F6183137570CF001A1ABA /* Frameworks */, 188 | ED2F6184137570CF001A1ABA /* Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | ); 194 | name = Demo; 195 | productName = Demo; 196 | productReference = ED2F6186137570CF001A1ABA /* Demo.app */; 197 | productType = "com.apple.product-type.application"; 198 | }; 199 | ED2F61A9137570CF001A1ABA /* XMLReaderTests */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = ED2F61C0137570CF001A1ABA /* Build configuration list for PBXNativeTarget "XMLReaderTests" */; 202 | buildPhases = ( 203 | ED2F61A5137570CF001A1ABA /* Sources */, 204 | ED2F61A6137570CF001A1ABA /* Frameworks */, 205 | ED2F61A7137570CF001A1ABA /* Resources */, 206 | ED2F61A8137570CF001A1ABA /* ShellScript */, 207 | ); 208 | buildRules = ( 209 | ); 210 | dependencies = ( 211 | ED2F61AF137570CF001A1ABA /* PBXTargetDependency */, 212 | ); 213 | name = XMLReaderTests; 214 | productName = DemoTests; 215 | productReference = ED2F61AA137570CF001A1ABA /* XMLReaderTests.octest */; 216 | productType = "com.apple.product-type.bundle"; 217 | }; 218 | /* End PBXNativeTarget section */ 219 | 220 | /* Begin PBXProject section */ 221 | ED2F617D137570CF001A1ABA /* Project object */ = { 222 | isa = PBXProject; 223 | buildConfigurationList = ED2F6180137570CF001A1ABA /* Build configuration list for PBXProject "Demo" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | ); 230 | mainGroup = ED2F617B137570CF001A1ABA; 231 | productRefGroup = ED2F6187137570CF001A1ABA /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | ED2F6185137570CF001A1ABA /* Demo */, 236 | ED2F61A9137570CF001A1ABA /* XMLReaderTests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | ED2F6184137570CF001A1ABA /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | ED2F6195137570CF001A1ABA /* InfoPlist.strings in Resources */, 247 | ED2F619E137570CF001A1ABA /* MainWindow.xib in Resources */, 248 | ED2F61A4137570CF001A1ABA /* DemoViewController.xib in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | ED2F61A7137570CF001A1ABA /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ED2F61D2137572AF001A1ABA /* InfoPlist.strings in Resources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXResourcesBuildPhase section */ 261 | 262 | /* Begin PBXShellScriptBuildPhase section */ 263 | ED2F61A8137570CF001A1ABA /* ShellScript */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputPaths = ( 269 | ); 270 | outputPaths = ( 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | shellPath = /bin/sh; 274 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 275 | }; 276 | /* End PBXShellScriptBuildPhase section */ 277 | 278 | /* Begin PBXSourcesBuildPhase section */ 279 | ED2F6182137570CF001A1ABA /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ED2F6198137570CF001A1ABA /* main.m in Sources */, 284 | ED2F619B137570CF001A1ABA /* DemoAppDelegate.m in Sources */, 285 | ED2F61A1137570CF001A1ABA /* DemoViewController.m in Sources */, 286 | ED2F61D81375734B001A1ABA /* XMLReader.m in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | ED2F61A5137570CF001A1ABA /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | ED2F61D4137572AF001A1ABA /* XMLReaderTests.m in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXTargetDependency section */ 301 | ED2F61AF137570CF001A1ABA /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = ED2F6185137570CF001A1ABA /* Demo */; 304 | targetProxy = ED2F61AE137570CF001A1ABA /* PBXContainerItemProxy */; 305 | }; 306 | /* End PBXTargetDependency section */ 307 | 308 | /* Begin PBXVariantGroup section */ 309 | ED2F6193137570CF001A1ABA /* InfoPlist.strings */ = { 310 | isa = PBXVariantGroup; 311 | children = ( 312 | ED2F6194137570CF001A1ABA /* en */, 313 | ); 314 | name = InfoPlist.strings; 315 | sourceTree = ""; 316 | }; 317 | ED2F619C137570CF001A1ABA /* MainWindow.xib */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | ED2F619D137570CF001A1ABA /* en */, 321 | ); 322 | name = MainWindow.xib; 323 | sourceTree = ""; 324 | }; 325 | ED2F61A2137570CF001A1ABA /* DemoViewController.xib */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | ED2F61A3137570CF001A1ABA /* en */, 329 | ); 330 | name = DemoViewController.xib; 331 | sourceTree = ""; 332 | }; 333 | ED2F61CC137572AF001A1ABA /* InfoPlist.strings */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | ED2F61CD137572AF001A1ABA /* en */, 337 | ); 338 | name = InfoPlist.strings; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | ED2F61BB137570CF001A1ABA /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 349 | GCC_C_LANGUAGE_STANDARD = gnu99; 350 | GCC_OPTIMIZATION_LEVEL = 0; 351 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 352 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 353 | GCC_VERSION = com.apple.compilers.llvmgcc42; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 357 | SDKROOT = iphoneos; 358 | }; 359 | name = Debug; 360 | }; 361 | ED2F61BC137570CF001A1ABA /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 365 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_VERSION = com.apple.compilers.llvmgcc42; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 371 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 372 | SDKROOT = iphoneos; 373 | }; 374 | name = Release; 375 | }; 376 | ED2F61BE137570CF001A1ABA /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | COPY_PHASE_STRIP = NO; 381 | GCC_DYNAMIC_NO_PIC = NO; 382 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 383 | GCC_PREFIX_HEADER = "Demo/Demo-Prefix.pch"; 384 | INFOPLIST_FILE = "Demo/Demo-Info.plist"; 385 | PRODUCT_NAME = "$(TARGET_NAME)"; 386 | WRAPPER_EXTENSION = app; 387 | }; 388 | name = Debug; 389 | }; 390 | ED2F61BF137570CF001A1ABA /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | COPY_PHASE_STRIP = YES; 395 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 396 | GCC_PREFIX_HEADER = "Demo/Demo-Prefix.pch"; 397 | INFOPLIST_FILE = "Demo/Demo-Info.plist"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | VALIDATE_PRODUCT = YES; 400 | WRAPPER_EXTENSION = app; 401 | }; 402 | name = Release; 403 | }; 404 | ED2F61C1137570CF001A1ABA /* Debug */ = { 405 | isa = XCBuildConfiguration; 406 | buildSettings = { 407 | ALWAYS_SEARCH_USER_PATHS = NO; 408 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; 409 | FRAMEWORK_SEARCH_PATHS = ( 410 | "$(SDKROOT)/Developer/Library/Frameworks", 411 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 412 | ); 413 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 414 | GCC_PREFIX_HEADER = "XMLReaderTests/XMLReaderTests-Prefix.pch"; 415 | INFOPLIST_FILE = "XMLReaderTests/XMLReaderTests-Info.plist"; 416 | OTHER_LDFLAGS = ( 417 | "-framework", 418 | SenTestingKit, 419 | ); 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | TEST_HOST = "$(BUNDLE_LOADER)"; 422 | WRAPPER_EXTENSION = octest; 423 | }; 424 | name = Debug; 425 | }; 426 | ED2F61C2137570CF001A1ABA /* Release */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ALWAYS_SEARCH_USER_PATHS = NO; 430 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; 431 | FRAMEWORK_SEARCH_PATHS = ( 432 | "$(SDKROOT)/Developer/Library/Frameworks", 433 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 434 | ); 435 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 436 | GCC_PREFIX_HEADER = "XMLReaderTests/XMLReaderTests-Prefix.pch"; 437 | INFOPLIST_FILE = "XMLReaderTests/XMLReaderTests-Info.plist"; 438 | OTHER_LDFLAGS = ( 439 | "-framework", 440 | SenTestingKit, 441 | ); 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | TEST_HOST = "$(BUNDLE_LOADER)"; 444 | WRAPPER_EXTENSION = octest; 445 | }; 446 | name = Release; 447 | }; 448 | /* End XCBuildConfiguration section */ 449 | 450 | /* Begin XCConfigurationList section */ 451 | ED2F6180137570CF001A1ABA /* Build configuration list for PBXProject "Demo" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | ED2F61BB137570CF001A1ABA /* Debug */, 455 | ED2F61BC137570CF001A1ABA /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | defaultConfigurationName = Release; 459 | }; 460 | ED2F61BD137570CF001A1ABA /* Build configuration list for PBXNativeTarget "Demo" */ = { 461 | isa = XCConfigurationList; 462 | buildConfigurations = ( 463 | ED2F61BE137570CF001A1ABA /* Debug */, 464 | ED2F61BF137570CF001A1ABA /* Release */, 465 | ); 466 | defaultConfigurationIsVisible = 0; 467 | defaultConfigurationName = Release; 468 | }; 469 | ED2F61C0137570CF001A1ABA /* Build configuration list for PBXNativeTarget "XMLReaderTests" */ = { 470 | isa = XCConfigurationList; 471 | buildConfigurations = ( 472 | ED2F61C1137570CF001A1ABA /* Debug */, 473 | ED2F61C2137570CF001A1ABA /* Release */, 474 | ); 475 | defaultConfigurationIsVisible = 0; 476 | defaultConfigurationName = Release; 477 | }; 478 | /* End XCConfigurationList section */ 479 | }; 480 | rootObject = ED2F617D137570CF001A1ABA /* Project object */; 481 | } 482 | -------------------------------------------------------------------------------- /Demo/Demo/Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.xmlreader.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Demo/Demo/Demo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Demo' target in the 'Demo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Demo/Demo/DemoAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoAppDelegate.h 3 | // Demo 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DemoViewController; 12 | 13 | @interface DemoAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet DemoViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Demo/Demo/DemoAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoAppDelegate.m 3 | // Demo 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "DemoAppDelegate.h" 10 | 11 | #import "DemoViewController.h" 12 | 13 | @implementation DemoAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 21 | { 22 | // Override point for customization after application launch. 23 | 24 | self.window.rootViewController = self.viewController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | /* 32 | 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. 33 | 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. 34 | */ 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 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 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application 46 | { 47 | /* 48 | 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. 49 | */ 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application 53 | { 54 | /* 55 | 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. 56 | */ 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application 60 | { 61 | /* 62 | Called when the application is about to terminate. 63 | Save data if appropriate. 64 | See also applicationDidEnterBackground:. 65 | */ 66 | } 67 | 68 | - (void)dealloc 69 | { 70 | [_window release]; 71 | [_viewController release]; 72 | [super dealloc]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Demo/Demo/DemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoViewController.h 3 | // Demo 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoViewController : UIViewController 12 | { 13 | NSDictionary *_xmlDictionary; 14 | UITableView *_tableView; 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Demo/Demo/DemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoViewController.m 3 | // Demo 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "DemoViewController.h" 10 | #import "XMLReader.h" 11 | 12 | @implementation DemoViewController 13 | 14 | @synthesize tableView=_tableView; 15 | 16 | - (void)dealloc 17 | { 18 | [_tableView release]; 19 | [_xmlDictionary release]; 20 | 21 | [super dealloc]; 22 | } 23 | 24 | - (void)didReceiveMemoryWarning 25 | { 26 | [super didReceiveMemoryWarning]; 27 | } 28 | 29 | #pragma mark - View lifecycle 30 | 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | 35 | // Grab some XML data from Twitter 36 | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://twitter.com/status/user_timeline/github"]]; 37 | 38 | NSError *error = nil; 39 | NSURLResponse *response = nil; 40 | 41 | // Synchronous isn't ideal, but simplifies the code for the Demo 42 | NSData *xmlData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; 43 | 44 | // Parse the XML Data into an NSDictionary 45 | _xmlDictionary = [[XMLReader dictionaryForXMLData:xmlData error:&error] retain]; 46 | 47 | [self.tableView reloadData]; 48 | } 49 | 50 | - (void)viewDidUnload 51 | { 52 | [super viewDidUnload]; 53 | 54 | self.tableView = nil; 55 | } 56 | 57 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 58 | { 59 | return YES; 60 | } 61 | 62 | #pragma mark - UITableViewDataSource 63 | 64 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 65 | { 66 | return [[_xmlDictionary retrieveForPath:@"statuses.status"] count]; 67 | } 68 | 69 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 70 | { 71 | return @"@github status feed"; 72 | } 73 | 74 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 75 | { 76 | static NSString *cellIdentifier = @"StatusCell"; 77 | 78 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 79 | 80 | if (cell == nil) 81 | { 82 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier] autorelease]; 83 | cell.textLabel.font = [UIFont systemFontOfSize:12]; 84 | cell.textLabel.numberOfLines = 2; 85 | cell.detailTextLabel.font = [UIFont systemFontOfSize:10]; 86 | cell.selectionStyle = UITableViewCellEditingStyleNone; 87 | } 88 | 89 | // Get the 'status' for the relevant row 90 | NSDictionary *status = [_xmlDictionary retrieveForPath:[NSString stringWithFormat:@"statuses.status.%d", indexPath.row]]; 91 | 92 | cell.textLabel.text = [status objectForKey:@"text"]; 93 | cell.detailTextLabel.text = [status objectForKey:@"created_at"]; 94 | 95 | return cell; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Demo/Demo/en.lproj/DemoViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J869 6 | 1305 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 300 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUIView 17 | IBUITableView 18 | 19 | 20 | YES 21 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 22 | 23 | 24 | YES 25 | 26 | YES 27 | 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 274 48 | {320, 460} 49 | 50 | 51 | 52 | 3 53 | MQA 54 | 55 | YES 56 | IBCocoaTouchFramework 57 | YES 58 | 1 59 | 0 60 | YES 61 | 44 62 | 22 63 | 22 64 | 65 | 66 | {{0, 20}, {320, 460}} 67 | 68 | 69 | 70 | 71 | 3 72 | MC43NQA 73 | 74 | 2 75 | 76 | 77 | NO 78 | 79 | IBCocoaTouchFramework 80 | 81 | 82 | 83 | 84 | YES 85 | 86 | 87 | view 88 | 89 | 90 | 91 | 7 92 | 93 | 94 | 95 | tableView 96 | 97 | 98 | 99 | 9 100 | 101 | 102 | 103 | dataSource 104 | 105 | 106 | 107 | 10 108 | 109 | 110 | 111 | delegate 112 | 113 | 114 | 115 | 11 116 | 117 | 118 | 119 | 120 | YES 121 | 122 | 0 123 | 124 | 125 | 126 | 127 | 128 | -1 129 | 130 | 131 | File's Owner 132 | 133 | 134 | -2 135 | 136 | 137 | 138 | 139 | 6 140 | 141 | 142 | YES 143 | 144 | 145 | 146 | 147 | 148 | 8 149 | 150 | 151 | 152 | 153 | 154 | 155 | YES 156 | 157 | YES 158 | -1.CustomClassName 159 | -2.CustomClassName 160 | 6.IBEditorWindowLastContentRect 161 | 6.IBPluginDependency 162 | 8.IBPluginDependency 163 | 164 | 165 | YES 166 | DemoViewController 167 | UIResponder 168 | {{239, 654}, {320, 480}} 169 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 170 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 171 | 172 | 173 | 174 | YES 175 | 176 | 177 | 178 | 179 | 180 | YES 181 | 182 | 183 | 184 | 185 | 11 186 | 187 | 188 | 189 | YES 190 | 191 | DemoViewController 192 | UIViewController 193 | 194 | tableView 195 | UITableView 196 | 197 | 198 | tableView 199 | 200 | tableView 201 | UITableView 202 | 203 | 204 | 205 | IBProjectSource 206 | ./Classes/DemoViewController.h 207 | 208 | 209 | 210 | 211 | 0 212 | IBCocoaTouchFramework 213 | 214 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 215 | 216 | 217 | YES 218 | 3 219 | 300 220 | 221 | 222 | -------------------------------------------------------------------------------- /Demo/Demo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Demo/Demo/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | DemoViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | Demo App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | DemoViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | DemoAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | DemoAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | DemoViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | DemoViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | DemoAppDelegate.h 227 | 228 | 229 | 230 | DemoAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | DemoViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | DemoViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | Demo.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /Demo/Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Demo/XMLReaderTests/XMLReaderTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.xmlreader.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Demo/XMLReaderTests/XMLReaderTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DemoTests' target in the 'DemoTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Demo/XMLReaderTests/XMLReaderTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMLReaderTests.h 3 | // XMLReaderTests 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XMLReaderTests : SenTestCase 12 | { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/XMLReaderTests/XMLReaderTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XMLReaderTests.m 3 | // XMLReaderTests 4 | // 5 | // Created by David Perry on 07/05/2011. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "XMLReaderTests.h" 10 | #import "XMLReader.h" 11 | 12 | @implementation XMLReaderTests 13 | 14 | - (void)setUp 15 | { 16 | [super setUp]; 17 | 18 | // Set-up code here. 19 | } 20 | 21 | - (void)tearDown 22 | { 23 | // Tear-down code here. 24 | 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testXMLReaderFailsWithNoData 29 | { 30 | NSData *data = nil; 31 | NSError *error = nil; 32 | 33 | NSDictionary *dictionary = [XMLReader dictionaryForXMLData:data error:&error]; 34 | 35 | STAssertNil(dictionary, @"dictionary should be nil"); 36 | STAssertNotNil(error, @"error should not be nil"); 37 | } 38 | 39 | - (void)testXMLReaderFailsWithNoString 40 | { 41 | NSString *string = nil; 42 | NSError *error = nil; 43 | 44 | NSDictionary *dictionary = [XMLReader dictionaryForXMLString:string error:&error]; 45 | 46 | STAssertNil(dictionary, @"dictionary should be nil"); 47 | STAssertNotNil(error, @"error should not be nil"); 48 | } 49 | 50 | - (void)testXMLReaderFailsWithInvalidPath 51 | { 52 | NSString *path = nil; 53 | NSError *error = nil; 54 | 55 | NSDictionary *dictionary = [XMLReader dictionaryForPath:path error:&error]; 56 | 57 | STAssertNil(dictionary, @"dictionary should be nil"); 58 | STAssertNotNil(error, @"error should not be nil"); 59 | } 60 | 61 | - (void)testXMLReaderFailsWithInvalidXML 62 | { 63 | NSString *xmlString = @"this is goodthis is bad"; 64 | NSError *error = nil; 65 | 66 | NSDictionary *dictionary = [XMLReader dictionaryForXMLString:xmlString error:&error]; 67 | 68 | STAssertNil(dictionary, @"dictionary should be nil"); 69 | STAssertNotNil(error, @"error should not be nil"); 70 | } 71 | 72 | - (void)testXMLReaderSucceedsWithBasicXML 73 | { 74 | NSString *xmlString = @"somevalue"; 75 | NSError *error = nil; 76 | 77 | NSDictionary *dictionary = [XMLReader dictionaryForXMLString:xmlString error:&error]; 78 | 79 | STAssertNotNil(dictionary, @"dictionary should not be nil"); 80 | STAssertNil(error, @"error should be nil"); 81 | STAssertTrue([[dictionary objectForKey:@"outernode"] isKindOfClass:[NSDictionary class]], @"outernode should be a dictionary"); 82 | STAssertTrue([[[dictionary objectForKey:@"outernode"] objectForKey:@"innernode"] isEqualToString:@"somevalue"], @"node values should match"); 83 | } 84 | 85 | - (void)testXMLReaderSucceedsWithComplexXML 86 | { 87 | NSData *xmlData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"complex" ofType:@"xml"]]; 88 | STAssertNotNil(xmlData, @"Failed to load XML file"); 89 | 90 | NSError *error = nil; 91 | 92 | NSDictionary *dictionary = [XMLReader dictionaryForXMLData:xmlData error:&error]; 93 | NSLog(@"%@", [dictionary description]); 94 | 95 | STAssertNotNil(dictionary, @"dictionary should not be nil"); 96 | STAssertNil(error, @"error should be nil"); 97 | 98 | // TODO: Spot check a few of the nodes are correct in the dictionary 99 | } 100 | 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Demo/XMLReaderTests/complex.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | QWZ5671 8 | 39.95 9 | 10 | Red 11 | Burgundy 12 | 13 | 14 | Red 15 | Burgundy 16 | 17 | 18 | 19 | RRX9856 20 | 42.50 21 | 22 | Red 23 | Navy 24 | Burgundy 25 | 26 | 27 | Red 28 | Navy 29 | Burgundy 30 | Black 31 | 32 | 33 | Navy 34 | Black 35 | 36 | 37 | Burgundy 38 | Black 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demo/XMLReaderTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dave-perry/XML-to-NSDictionary/36de9514d4ecdd7853f3eb5a16b825a1ef69b208/README -------------------------------------------------------------------------------- /XMLReader.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMLReader.h 3 | // 4 | // 5 | 6 | #import 7 | 8 | @interface XMLReader : NSObject 9 | { 10 | NSMutableArray *dictionaryStack; 11 | NSMutableString *textInProgress; 12 | NSError **errorPointer; 13 | } 14 | 15 | + (NSDictionary *)dictionaryForPath:(NSString *)path error:(NSError **)errorPointer; 16 | + (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)errorPointer; 17 | + (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)errorPointer; 18 | 19 | @end 20 | 21 | @interface NSDictionary (XMLReaderNavigation) 22 | 23 | - (id)retrieveForPath:(NSString *)navPath; 24 | 25 | @end -------------------------------------------------------------------------------- /XMLReader.m: -------------------------------------------------------------------------------- 1 | // 2 | // XMLReader.m 3 | // 4 | 5 | #import "XMLReader.h" 6 | 7 | NSString *const kXMLReaderTextNodeKey = @"text"; 8 | 9 | @interface XMLReader (Internal) 10 | 11 | - (id)initWithError:(NSError **)error; 12 | - (NSDictionary *)objectWithData:(NSData *)data; 13 | 14 | @end 15 | 16 | @implementation NSDictionary (XMLReaderNavigation) 17 | 18 | - (id)retrieveForPath:(NSString *)navPath 19 | { 20 | // Split path on dots 21 | NSArray *pathItems = [navPath componentsSeparatedByString:@"."]; 22 | 23 | // Enumerate through array 24 | NSEnumerator *e = [pathItems objectEnumerator]; 25 | NSString *path; 26 | 27 | // Set first branch from self 28 | id branch = [self objectForKey:[e nextObject]]; 29 | int count = 1; 30 | 31 | while ((path = [e nextObject])) 32 | { 33 | // Check if this branch is an NSArray 34 | if([branch isKindOfClass:[NSArray class]]) 35 | { 36 | if ([path isEqualToString:@"last"]) 37 | { 38 | branch = [branch lastObject]; 39 | } 40 | else 41 | { 42 | if ([branch count] > [path intValue]) 43 | { 44 | branch = [branch objectAtIndex:[path intValue]]; 45 | } 46 | else 47 | { 48 | branch = nil; 49 | } 50 | } 51 | } 52 | else 53 | { 54 | // branch is assumed to be an NSDictionary 55 | branch = [branch objectForKey:path]; 56 | } 57 | 58 | count++; 59 | } 60 | 61 | return branch; 62 | } 63 | 64 | @end 65 | 66 | @implementation XMLReader 67 | 68 | #pragma mark - 69 | #pragma mark Public methods 70 | 71 | + (NSDictionary *)dictionaryForPath:(NSString *)path error:(NSError **)errorPointer 72 | { 73 | NSString *fullpath = [[NSBundle bundleForClass:self] pathForResource:path ofType:@"xml"]; 74 | NSData *data = [[NSFileManager defaultManager] contentsAtPath:fullpath]; 75 | NSDictionary *rootDictionary = [XMLReader dictionaryForXMLData:data error:errorPointer]; 76 | 77 | return rootDictionary; 78 | } 79 | 80 | + (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)error 81 | { 82 | XMLReader *reader = [[XMLReader alloc] initWithError:error]; 83 | NSDictionary *rootDictionary = [reader objectWithData:data]; 84 | [reader release]; 85 | 86 | return rootDictionary; 87 | } 88 | 89 | + (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)error 90 | { 91 | NSArray* lines = [string componentsSeparatedByString:@"\n"]; 92 | NSMutableString* strData = [NSMutableString stringWithString:@""]; 93 | 94 | for (int i = 0; i < [lines count]; i++) 95 | { 96 | [strData appendString:[[lines objectAtIndex:i] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; 97 | } 98 | 99 | NSData *data = [strData dataUsingEncoding:NSUTF8StringEncoding]; 100 | return [XMLReader dictionaryForXMLData:data error:error]; 101 | } 102 | 103 | #pragma mark - 104 | #pragma mark Parsing 105 | 106 | - (id)initWithError:(NSError **)error 107 | { 108 | if ((self = [super init])) 109 | { 110 | errorPointer = error; 111 | } 112 | 113 | return self; 114 | } 115 | 116 | - (void)dealloc 117 | { 118 | [dictionaryStack release]; 119 | [textInProgress release]; 120 | 121 | [super dealloc]; 122 | } 123 | 124 | - (NSDictionary *)objectWithData:(NSData *)data 125 | { 126 | // Clear out any old data 127 | [dictionaryStack release]; 128 | [textInProgress release]; 129 | 130 | dictionaryStack = [[NSMutableArray alloc] init]; 131 | textInProgress = [[NSMutableString alloc] init]; 132 | 133 | // Initialize the stack with a fresh dictionary 134 | [dictionaryStack addObject:[NSMutableDictionary dictionary]]; 135 | 136 | // Parse the XML 137 | NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; 138 | parser.delegate = self; 139 | BOOL success = [parser parse]; 140 | [parser release]; 141 | 142 | // Return the stack's root dictionary on success 143 | if (success) 144 | { 145 | NSDictionary *resultDict = [dictionaryStack objectAtIndex:0]; 146 | 147 | return resultDict; 148 | } 149 | 150 | return nil; 151 | } 152 | 153 | #pragma mark - 154 | #pragma mark NSXMLParserDelegate methods 155 | 156 | - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict 157 | { 158 | // Get the dictionary for the current level in the stack 159 | NSMutableDictionary *parentDict = [dictionaryStack lastObject]; 160 | 161 | // Create the child dictionary for the new element 162 | NSMutableDictionary *childDict = [NSMutableDictionary dictionary]; 163 | 164 | // Initialize child dictionary with the attributes, prefixed with '@' 165 | for (NSString *key in attributeDict) { 166 | [childDict setValue:[attributeDict objectForKey:key] 167 | forKey:[NSString stringWithFormat:@"@%@", key]]; 168 | } 169 | 170 | // If there's already an item for this key, it means we need to create an array 171 | id existingValue = [parentDict objectForKey:elementName]; 172 | 173 | if (existingValue) 174 | { 175 | NSMutableArray *array = nil; 176 | 177 | if ([existingValue isKindOfClass:[NSMutableArray class]]) 178 | { 179 | // The array exists, so use it 180 | array = (NSMutableArray *) existingValue; 181 | } 182 | else 183 | { 184 | // Create an array if it doesn't exist 185 | array = [NSMutableArray array]; 186 | [array addObject:existingValue]; 187 | 188 | // Replace the child dictionary with an array of children dictionaries 189 | [parentDict setObject:array forKey:elementName]; 190 | } 191 | 192 | // Add the new child dictionary to the array 193 | [array addObject:childDict]; 194 | } 195 | else 196 | { 197 | // No existing value, so update the dictionary 198 | [parentDict setObject:childDict forKey:elementName]; 199 | } 200 | 201 | // Update the stack 202 | [dictionaryStack addObject:childDict]; 203 | } 204 | 205 | - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName 206 | { 207 | // Update the parent dict with text info 208 | NSMutableDictionary *dictInProgress = [dictionaryStack lastObject]; 209 | 210 | // Pop the current dict 211 | [dictionaryStack removeLastObject]; 212 | 213 | // Set the text property 214 | if ([textInProgress length] > 0) 215 | { 216 | if ([dictInProgress count] > 0) 217 | { 218 | [dictInProgress setObject:textInProgress forKey:kXMLReaderTextNodeKey]; 219 | } 220 | else 221 | { 222 | // Given that there will only ever be a single value in this dictionary, let's replace the dictionary with a simple string. 223 | NSMutableDictionary *parentDict = [dictionaryStack lastObject]; 224 | id parentObject = [parentDict objectForKey:elementName]; 225 | 226 | // Parent is an Array 227 | if ([parentObject isKindOfClass:[NSArray class]]) 228 | { 229 | [parentObject removeLastObject]; 230 | [parentObject addObject:textInProgress]; 231 | } 232 | 233 | // Parent is a Dictionary 234 | else 235 | { 236 | [parentDict removeObjectForKey:elementName]; 237 | [parentDict setObject:textInProgress forKey:elementName]; 238 | } 239 | } 240 | 241 | // Reset the text 242 | [textInProgress release]; 243 | textInProgress = [[NSMutableString alloc] init]; 244 | } 245 | 246 | // If there was no value for the tag, and no attribute, then remove it from the dictionary. 247 | else if ([dictInProgress count] == 0) 248 | { 249 | NSMutableDictionary *parentDict = [dictionaryStack lastObject]; 250 | [parentDict removeObjectForKey:elementName]; 251 | } 252 | } 253 | 254 | - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string 255 | { 256 | // Build the text value 257 | [textInProgress appendString:[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; 258 | } 259 | 260 | - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError 261 | { 262 | // Set the error pointer to the parser's error object 263 | if (errorPointer) 264 | *errorPointer = parseError; 265 | } 266 | 267 | @end --------------------------------------------------------------------------------