├── .gitignore ├── README.md ├── Serialisation Test.xcodeproj └── project.pbxproj ├── Serialisation Test ├── AppDelegate.h ├── AppDelegate.m ├── Model.h ├── Model.m ├── Serialisation Test-Info.plist ├── Serialisation Test-Prefix.pch ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib └── main.m └── Serialisation TestTests ├── Serialisation TestTests-Info.plist ├── Serialisation_TestTests.h ├── Serialisation_TestTests.m └── en.lproj └── InfoPlist.strings /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NSSerialisationTests 2 | ==================== 3 | 4 | Tests for NSJSONSerialization, NSPropertyListSerialization, NSArchiver, NSKeyedArchiver 5 | 6 | Test app for various native object serialisation APIs 7 | 8 | Sample model object: 9 | 10 | { 11 | UUID = "90B471CC-C740-4C1E-A421-EA996E34B505"; 12 | point = "{1026495492, 1745139186}"; 13 | rect = "{{1026495492, 1745139186}, {2609842131, 1633372867} 14 | } 15 | 16 | Results serialising / deserialising 100,000 model objects on a 2.66GHz Mac Pro (seconds): 17 | 18 | NSJSONSerialization 2.359547 19 | NSPropertyListSerialization 3.560538 20 | NSArchiver 3.681572 21 | NSKeyedArchiver 9.563317 22 | -------------------------------------------------------------------------------- /Serialisation Test.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5B823AC4173C3863005C0AAC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B823AC3173C3863005C0AAC /* Cocoa.framework */; }; 11 | 5B823ACE173C3863005C0AAC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5B823ACC173C3863005C0AAC /* InfoPlist.strings */; }; 12 | 5B823AD0173C3863005C0AAC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B823ACF173C3863005C0AAC /* main.m */; }; 13 | 5B823AD4173C3863005C0AAC /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 5B823AD2173C3863005C0AAC /* Credits.rtf */; }; 14 | 5B823AD7173C3863005C0AAC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B823AD6173C3863005C0AAC /* AppDelegate.m */; }; 15 | 5B823ADA173C3863005C0AAC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B823AD8173C3863005C0AAC /* MainMenu.xib */; }; 16 | 5B823AE2173C3863005C0AAC /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B823AE1173C3863005C0AAC /* SenTestingKit.framework */; }; 17 | 5B823AE3173C3863005C0AAC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B823AC3173C3863005C0AAC /* Cocoa.framework */; }; 18 | 5B823AEB173C3863005C0AAC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5B823AE9173C3863005C0AAC /* InfoPlist.strings */; }; 19 | 5B823AEE173C3863005C0AAC /* Serialisation_TestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B823AED173C3863005C0AAC /* Serialisation_TestTests.m */; }; 20 | 5B823AF9173C387F005C0AAC /* Model.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B823AF8173C387F005C0AAC /* Model.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 5B823AE4173C3863005C0AAC /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 5B823AB8173C3863005C0AAC /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 5B823ABF173C3863005C0AAC; 29 | remoteInfo = "Serialisation Test"; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 5B823AC0173C3863005C0AAC /* Serialisation Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Serialisation Test.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 5B823AC3173C3863005C0AAC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 36 | 5B823AC6173C3863005C0AAC /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 37 | 5B823AC7173C3863005C0AAC /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 38 | 5B823AC8173C3863005C0AAC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 39 | 5B823ACB173C3863005C0AAC /* Serialisation Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Serialisation Test-Info.plist"; sourceTree = ""; }; 40 | 5B823ACD173C3863005C0AAC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 41 | 5B823ACF173C3863005C0AAC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | 5B823AD1173C3863005C0AAC /* Serialisation Test-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Serialisation Test-Prefix.pch"; sourceTree = ""; }; 43 | 5B823AD3173C3863005C0AAC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 44 | 5B823AD5173C3863005C0AAC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 5B823AD6173C3863005C0AAC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 5B823AD9173C3863005C0AAC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 47 | 5B823AE0173C3863005C0AAC /* Serialisation TestTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Serialisation TestTests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 5B823AE1173C3863005C0AAC /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 49 | 5B823AE8173C3863005C0AAC /* Serialisation TestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Serialisation TestTests-Info.plist"; sourceTree = ""; }; 50 | 5B823AEA173C3863005C0AAC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 51 | 5B823AEC173C3863005C0AAC /* Serialisation_TestTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Serialisation_TestTests.h; sourceTree = ""; }; 52 | 5B823AED173C3863005C0AAC /* Serialisation_TestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Serialisation_TestTests.m; sourceTree = ""; }; 53 | 5B823AF7173C387F005C0AAC /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = ""; }; 54 | 5B823AF8173C387F005C0AAC /* Model.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Model.m; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 5B823ABD173C3863005C0AAC /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 5B823AC4173C3863005C0AAC /* Cocoa.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 5B823ADC173C3863005C0AAC /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 5B823AE2173C3863005C0AAC /* SenTestingKit.framework in Frameworks */, 71 | 5B823AE3173C3863005C0AAC /* Cocoa.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 5B823AB7173C3863005C0AAC = { 79 | isa = PBXGroup; 80 | children = ( 81 | 5B823AC9173C3863005C0AAC /* Serialisation Test */, 82 | 5B823AE6173C3863005C0AAC /* Serialisation TestTests */, 83 | 5B823AC2173C3863005C0AAC /* Frameworks */, 84 | 5B823AC1173C3863005C0AAC /* Products */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | 5B823AC1173C3863005C0AAC /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 5B823AC0173C3863005C0AAC /* Serialisation Test.app */, 92 | 5B823AE0173C3863005C0AAC /* Serialisation TestTests.octest */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | 5B823AC2173C3863005C0AAC /* Frameworks */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 5B823AC3173C3863005C0AAC /* Cocoa.framework */, 101 | 5B823AE1173C3863005C0AAC /* SenTestingKit.framework */, 102 | 5B823AC5173C3863005C0AAC /* Other Frameworks */, 103 | ); 104 | name = Frameworks; 105 | sourceTree = ""; 106 | }; 107 | 5B823AC5173C3863005C0AAC /* Other Frameworks */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 5B823AC6173C3863005C0AAC /* AppKit.framework */, 111 | 5B823AC7173C3863005C0AAC /* CoreData.framework */, 112 | 5B823AC8173C3863005C0AAC /* Foundation.framework */, 113 | ); 114 | name = "Other Frameworks"; 115 | sourceTree = ""; 116 | }; 117 | 5B823AC9173C3863005C0AAC /* Serialisation Test */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 5B823AD5173C3863005C0AAC /* AppDelegate.h */, 121 | 5B823AD6173C3863005C0AAC /* AppDelegate.m */, 122 | 5B823AD8173C3863005C0AAC /* MainMenu.xib */, 123 | 5B823ACA173C3863005C0AAC /* Supporting Files */, 124 | 5B823AF7173C387F005C0AAC /* Model.h */, 125 | 5B823AF8173C387F005C0AAC /* Model.m */, 126 | ); 127 | path = "Serialisation Test"; 128 | sourceTree = ""; 129 | }; 130 | 5B823ACA173C3863005C0AAC /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 5B823ACB173C3863005C0AAC /* Serialisation Test-Info.plist */, 134 | 5B823ACC173C3863005C0AAC /* InfoPlist.strings */, 135 | 5B823ACF173C3863005C0AAC /* main.m */, 136 | 5B823AD1173C3863005C0AAC /* Serialisation Test-Prefix.pch */, 137 | 5B823AD2173C3863005C0AAC /* Credits.rtf */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | 5B823AE6173C3863005C0AAC /* Serialisation TestTests */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 5B823AEC173C3863005C0AAC /* Serialisation_TestTests.h */, 146 | 5B823AED173C3863005C0AAC /* Serialisation_TestTests.m */, 147 | 5B823AE7173C3863005C0AAC /* Supporting Files */, 148 | ); 149 | path = "Serialisation TestTests"; 150 | sourceTree = ""; 151 | }; 152 | 5B823AE7173C3863005C0AAC /* Supporting Files */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 5B823AE8173C3863005C0AAC /* Serialisation TestTests-Info.plist */, 156 | 5B823AE9173C3863005C0AAC /* InfoPlist.strings */, 157 | ); 158 | name = "Supporting Files"; 159 | sourceTree = ""; 160 | }; 161 | /* End PBXGroup section */ 162 | 163 | /* Begin PBXNativeTarget section */ 164 | 5B823ABF173C3863005C0AAC /* Serialisation Test */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 5B823AF1173C3863005C0AAC /* Build configuration list for PBXNativeTarget "Serialisation Test" */; 167 | buildPhases = ( 168 | 5B823ABC173C3863005C0AAC /* Sources */, 169 | 5B823ABD173C3863005C0AAC /* Frameworks */, 170 | 5B823ABE173C3863005C0AAC /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = "Serialisation Test"; 177 | productName = "Serialisation Test"; 178 | productReference = 5B823AC0173C3863005C0AAC /* Serialisation Test.app */; 179 | productType = "com.apple.product-type.application"; 180 | }; 181 | 5B823ADF173C3863005C0AAC /* Serialisation TestTests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = 5B823AF4173C3863005C0AAC /* Build configuration list for PBXNativeTarget "Serialisation TestTests" */; 184 | buildPhases = ( 185 | 5B823ADB173C3863005C0AAC /* Sources */, 186 | 5B823ADC173C3863005C0AAC /* Frameworks */, 187 | 5B823ADD173C3863005C0AAC /* Resources */, 188 | 5B823ADE173C3863005C0AAC /* ShellScript */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | 5B823AE5173C3863005C0AAC /* PBXTargetDependency */, 194 | ); 195 | name = "Serialisation TestTests"; 196 | productName = "Serialisation TestTests"; 197 | productReference = 5B823AE0173C3863005C0AAC /* Serialisation TestTests.octest */; 198 | productType = "com.apple.product-type.bundle"; 199 | }; 200 | /* End PBXNativeTarget section */ 201 | 202 | /* Begin PBXProject section */ 203 | 5B823AB8173C3863005C0AAC /* Project object */ = { 204 | isa = PBXProject; 205 | attributes = { 206 | LastUpgradeCheck = 0460; 207 | ORGANIZATIONNAME = "Random Sequence"; 208 | }; 209 | buildConfigurationList = 5B823ABB173C3863005C0AAC /* Build configuration list for PBXProject "Serialisation Test" */; 210 | compatibilityVersion = "Xcode 3.2"; 211 | developmentRegion = English; 212 | hasScannedForEncodings = 0; 213 | knownRegions = ( 214 | en, 215 | ); 216 | mainGroup = 5B823AB7173C3863005C0AAC; 217 | productRefGroup = 5B823AC1173C3863005C0AAC /* Products */; 218 | projectDirPath = ""; 219 | projectRoot = ""; 220 | targets = ( 221 | 5B823ABF173C3863005C0AAC /* Serialisation Test */, 222 | 5B823ADF173C3863005C0AAC /* Serialisation TestTests */, 223 | ); 224 | }; 225 | /* End PBXProject section */ 226 | 227 | /* Begin PBXResourcesBuildPhase section */ 228 | 5B823ABE173C3863005C0AAC /* Resources */ = { 229 | isa = PBXResourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 5B823ACE173C3863005C0AAC /* InfoPlist.strings in Resources */, 233 | 5B823AD4173C3863005C0AAC /* Credits.rtf in Resources */, 234 | 5B823ADA173C3863005C0AAC /* MainMenu.xib in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | 5B823ADD173C3863005C0AAC /* Resources */ = { 239 | isa = PBXResourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | 5B823AEB173C3863005C0AAC /* InfoPlist.strings in Resources */, 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | }; 246 | /* End PBXResourcesBuildPhase section */ 247 | 248 | /* Begin PBXShellScriptBuildPhase section */ 249 | 5B823ADE173C3863005C0AAC /* ShellScript */ = { 250 | isa = PBXShellScriptBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | inputPaths = ( 255 | ); 256 | outputPaths = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | shellPath = /bin/sh; 260 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 261 | }; 262 | /* End PBXShellScriptBuildPhase section */ 263 | 264 | /* Begin PBXSourcesBuildPhase section */ 265 | 5B823ABC173C3863005C0AAC /* Sources */ = { 266 | isa = PBXSourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | 5B823AD0173C3863005C0AAC /* main.m in Sources */, 270 | 5B823AD7173C3863005C0AAC /* AppDelegate.m in Sources */, 271 | 5B823AF9173C387F005C0AAC /* Model.m in Sources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 5B823ADB173C3863005C0AAC /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 5B823AEE173C3863005C0AAC /* Serialisation_TestTests.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXSourcesBuildPhase section */ 284 | 285 | /* Begin PBXTargetDependency section */ 286 | 5B823AE5173C3863005C0AAC /* PBXTargetDependency */ = { 287 | isa = PBXTargetDependency; 288 | target = 5B823ABF173C3863005C0AAC /* Serialisation Test */; 289 | targetProxy = 5B823AE4173C3863005C0AAC /* PBXContainerItemProxy */; 290 | }; 291 | /* End PBXTargetDependency section */ 292 | 293 | /* Begin PBXVariantGroup section */ 294 | 5B823ACC173C3863005C0AAC /* InfoPlist.strings */ = { 295 | isa = PBXVariantGroup; 296 | children = ( 297 | 5B823ACD173C3863005C0AAC /* en */, 298 | ); 299 | name = InfoPlist.strings; 300 | sourceTree = ""; 301 | }; 302 | 5B823AD2173C3863005C0AAC /* Credits.rtf */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | 5B823AD3173C3863005C0AAC /* en */, 306 | ); 307 | name = Credits.rtf; 308 | sourceTree = ""; 309 | }; 310 | 5B823AD8173C3863005C0AAC /* MainMenu.xib */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | 5B823AD9173C3863005C0AAC /* en */, 314 | ); 315 | name = MainMenu.xib; 316 | sourceTree = ""; 317 | }; 318 | 5B823AE9173C3863005C0AAC /* InfoPlist.strings */ = { 319 | isa = PBXVariantGroup; 320 | children = ( 321 | 5B823AEA173C3863005C0AAC /* en */, 322 | ); 323 | name = InfoPlist.strings; 324 | sourceTree = ""; 325 | }; 326 | /* End PBXVariantGroup section */ 327 | 328 | /* Begin XCBuildConfiguration section */ 329 | 5B823AEF173C3863005C0AAC /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_OBJC_ARC = YES; 337 | CLANG_WARN_CONSTANT_CONVERSION = YES; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 342 | COPY_PHASE_STRIP = NO; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 353 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | MACOSX_DEPLOYMENT_TARGET = 10.8; 357 | ONLY_ACTIVE_ARCH = YES; 358 | SDKROOT = macosx; 359 | }; 360 | name = Debug; 361 | }; 362 | 5B823AF0173C3863005C0AAC /* Release */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ALWAYS_SEARCH_USER_PATHS = NO; 366 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 367 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 368 | CLANG_CXX_LIBRARY = "libc++"; 369 | CLANG_ENABLE_OBJC_ARC = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_EMPTY_BODY = YES; 372 | CLANG_WARN_ENUM_CONVERSION = YES; 373 | CLANG_WARN_INT_CONVERSION = YES; 374 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 375 | COPY_PHASE_STRIP = YES; 376 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 377 | GCC_C_LANGUAGE_STANDARD = gnu99; 378 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 379 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 380 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 381 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | MACOSX_DEPLOYMENT_TARGET = 10.8; 384 | SDKROOT = macosx; 385 | }; 386 | name = Release; 387 | }; 388 | 5B823AF2173C3863005C0AAC /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | COMBINE_HIDPI_IMAGES = YES; 392 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 393 | GCC_PREFIX_HEADER = "Serialisation Test/Serialisation Test-Prefix.pch"; 394 | INFOPLIST_FILE = "Serialisation Test/Serialisation Test-Info.plist"; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | WRAPPER_EXTENSION = app; 397 | }; 398 | name = Debug; 399 | }; 400 | 5B823AF3173C3863005C0AAC /* Release */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | COMBINE_HIDPI_IMAGES = YES; 404 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 405 | GCC_PREFIX_HEADER = "Serialisation Test/Serialisation Test-Prefix.pch"; 406 | INFOPLIST_FILE = "Serialisation Test/Serialisation Test-Info.plist"; 407 | PRODUCT_NAME = "$(TARGET_NAME)"; 408 | WRAPPER_EXTENSION = app; 409 | }; 410 | name = Release; 411 | }; 412 | 5B823AF5173C3863005C0AAC /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Serialisation Test.app/Contents/MacOS/Serialisation Test"; 416 | COMBINE_HIDPI_IMAGES = YES; 417 | FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; 418 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 419 | GCC_PREFIX_HEADER = "Serialisation Test/Serialisation Test-Prefix.pch"; 420 | INFOPLIST_FILE = "Serialisation TestTests/Serialisation TestTests-Info.plist"; 421 | PRODUCT_NAME = "$(TARGET_NAME)"; 422 | TEST_HOST = "$(BUNDLE_LOADER)"; 423 | WRAPPER_EXTENSION = octest; 424 | }; 425 | name = Debug; 426 | }; 427 | 5B823AF6173C3863005C0AAC /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Serialisation Test.app/Contents/MacOS/Serialisation Test"; 431 | COMBINE_HIDPI_IMAGES = YES; 432 | FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; 433 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 434 | GCC_PREFIX_HEADER = "Serialisation Test/Serialisation Test-Prefix.pch"; 435 | INFOPLIST_FILE = "Serialisation TestTests/Serialisation TestTests-Info.plist"; 436 | PRODUCT_NAME = "$(TARGET_NAME)"; 437 | TEST_HOST = "$(BUNDLE_LOADER)"; 438 | WRAPPER_EXTENSION = octest; 439 | }; 440 | name = Release; 441 | }; 442 | /* End XCBuildConfiguration section */ 443 | 444 | /* Begin XCConfigurationList section */ 445 | 5B823ABB173C3863005C0AAC /* Build configuration list for PBXProject "Serialisation Test" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 5B823AEF173C3863005C0AAC /* Debug */, 449 | 5B823AF0173C3863005C0AAC /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | 5B823AF1173C3863005C0AAC /* Build configuration list for PBXNativeTarget "Serialisation Test" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 5B823AF2173C3863005C0AAC /* Debug */, 458 | 5B823AF3173C3863005C0AAC /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | }; 462 | 5B823AF4173C3863005C0AAC /* Build configuration list for PBXNativeTarget "Serialisation TestTests" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 5B823AF5173C3863005C0AAC /* Debug */, 466 | 5B823AF6173C3863005C0AAC /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | }; 470 | /* End XCConfigurationList section */ 471 | }; 472 | rootObject = 5B823AB8173C3863005C0AAC /* Project object */; 473 | } 474 | -------------------------------------------------------------------------------- /Serialisation Test/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Serialisation Test 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | @property (assign) IBOutlet NSWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Serialisation Test/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Serialisation Test 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 14 | { 15 | // Insert code here to initialize your application 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Serialisation Test/Model.h: -------------------------------------------------------------------------------- 1 | // 2 | // Model.h 3 | // Serialisation Test 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Model : NSObject 12 | @property (nonatomic) NSRect rect; 13 | @property (nonatomic) NSPoint point; 14 | @property (nonatomic, copy) NSString *UUID; 15 | 16 | + (id)model; 17 | - (NSDictionary *)dict; 18 | + (id)modelWithDictionary:(NSDictionary *)dictionary; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Serialisation Test/Model.m: -------------------------------------------------------------------------------- 1 | // 2 | // Model.m 3 | // Serialisation Test 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import "Model.h" 10 | 11 | NSString * const UUIDKey = @"UUID"; 12 | NSString * const PointKey = @"point"; 13 | NSString * const RectKey = @"rect"; 14 | 15 | @implementation Model 16 | 17 | + (id)model { 18 | Model *model = [Model new]; 19 | model.UUID = [[NSUUID UUID] UUIDString]; 20 | model.point = NSMakePoint(arc4random(), arc4random()); 21 | model.rect = NSMakeRect(model.point.x, model.point.y, arc4random(), arc4random()); 22 | return model; 23 | } 24 | 25 | - (void)encodeWithCoder:(NSCoder *)aCoder { 26 | if ([aCoder allowsKeyedCoding]) { 27 | [aCoder encodeObject:self.UUID forKey:UUIDKey]; 28 | [aCoder encodePoint:self.point forKey:PointKey]; 29 | [aCoder encodeRect:self.rect forKey:RectKey]; 30 | } else { 31 | [aCoder encodeObject:self.UUID]; 32 | [aCoder encodePoint:self.point]; 33 | [aCoder encodeRect:self.rect]; 34 | } 35 | } 36 | 37 | - (id)initWithCoder:(NSCoder *)decoder { 38 | self = [super init]; 39 | if (self) { 40 | if ([decoder allowsKeyedCoding]) { 41 | self.UUID = [decoder decodeObjectForKey:UUIDKey]; 42 | self.point = [decoder decodePointForKey:PointKey]; 43 | self.rect = [decoder decodeRectForKey:RectKey]; 44 | } else { 45 | self.UUID = [decoder decodeObject]; 46 | self.point = [decoder decodePoint]; 47 | self.rect = [decoder decodeRect]; 48 | } 49 | } 50 | return self; 51 | } 52 | 53 | - (NSDictionary *)dict { 54 | return @{ 55 | UUIDKey: self.UUID, 56 | PointKey: NSStringFromPoint(self.point), 57 | RectKey: NSStringFromRect(self.rect) 58 | }; 59 | } 60 | 61 | + (id)modelWithDictionary:(NSDictionary *)dictionary { 62 | Model *model = [Model new]; 63 | model.UUID = [dictionary objectForKey:UUIDKey]; 64 | model.point = NSPointFromString([dictionary objectForKey:PointKey]); 65 | model.rect = NSRectFromString([dictionary objectForKey:RectKey]); 66 | return model; 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Serialisation Test/Serialisation Test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.randomsequence.stickynotes.${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 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2013 Random Sequence. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Serialisation Test/Serialisation Test-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Serialisation Test' target in the 'Serialisation Test' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Serialisation Test/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Serialisation Test/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Serialisation Test/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Serialisation Test 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /Serialisation TestTests/Serialisation TestTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.randomsequence.stickynotes.${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 | -------------------------------------------------------------------------------- /Serialisation TestTests/Serialisation_TestTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Serialisation_TestTests.h 3 | // Serialisation TestTests 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Serialisation_TestTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Serialisation TestTests/Serialisation_TestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Serialisation_TestTests.m 3 | // Serialisation TestTests 4 | // 5 | // Created by Johnnie Walker on 09/05/2013. 6 | // Copyright (c) 2013 Random Sequence. All rights reserved. 7 | // 8 | 9 | #import "Serialisation_TestTests.h" 10 | #import "Model.h" 11 | 12 | #define ITERATIONS 100000 13 | 14 | @interface Serialisation_TestTests () 15 | @property (nonatomic, strong) NSArray *models; 16 | @end 17 | 18 | @implementation Serialisation_TestTests 19 | 20 | - (void)setUp { 21 | NSMutableArray *models = [NSMutableArray arrayWithCapacity:ITERATIONS]; 22 | for (NSInteger i=0; i