├── .gitignore ├── Introduction.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── yuichi.takeda.xcuserdatad │ └── xcschemes │ ├── Introduction.xcscheme │ └── xcschememanagement.plist ├── Introduction ├── Base.lproj │ └── Main.storyboard ├── INTAppDelegate.h ├── INTAppDelegate.m ├── INTViewController.h ├── INTViewController.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Introduction-Info.plist ├── Introduction-Prefix.pch ├── UltraObject.h ├── UltraObject.m ├── UltraObjectAnswer.h ├── UltraObjectAnswer.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── IntroductionTests ├── ClassAndMethodTest.m ├── IntroductionTests-Info.plist ├── IntroductionTests.m ├── IntroductionTestsAnswer.m └── en.lproj │ └── InfoPlist.strings └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata 2 | *.xcworkspace 3 | -------------------------------------------------------------------------------- /Introduction.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 542072D81A5BEBB500E5C8F8 /* IntroductionTestsAnswer.m in Sources */ = {isa = PBXBuildFile; fileRef = 542072D71A5BEBB500E5C8F8 /* IntroductionTestsAnswer.m */; }; 11 | 542072DB1A5BF4CC00E5C8F8 /* UltraObjectAnswer.m in Sources */ = {isa = PBXBuildFile; fileRef = 542072DA1A5BF4CC00E5C8F8 /* UltraObjectAnswer.m */; }; 12 | 542072DC1A5BF4FD00E5C8F8 /* UltraObjectAnswer.m in Sources */ = {isa = PBXBuildFile; fileRef = 542072DA1A5BF4CC00E5C8F8 /* UltraObjectAnswer.m */; }; 13 | 5439D23819051C21002C84BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5439D23719051C21002C84BA /* Foundation.framework */; }; 14 | 5439D23A19051C21002C84BA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5439D23919051C21002C84BA /* CoreGraphics.framework */; }; 15 | 5439D23C19051C21002C84BA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5439D23B19051C21002C84BA /* UIKit.framework */; }; 16 | 5439D24219051C21002C84BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5439D24019051C21002C84BA /* InfoPlist.strings */; }; 17 | 5439D24419051C21002C84BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D24319051C21002C84BA /* main.m */; }; 18 | 5439D24819051C21002C84BA /* INTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D24719051C21002C84BA /* INTAppDelegate.m */; }; 19 | 5439D24B19051C21002C84BA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5439D24919051C21002C84BA /* Main.storyboard */; }; 20 | 5439D24E19051C21002C84BA /* INTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D24D19051C21002C84BA /* INTViewController.m */; }; 21 | 5439D25019051C21002C84BA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5439D24F19051C21002C84BA /* Images.xcassets */; }; 22 | 5439D25719051C21002C84BA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5439D25619051C21002C84BA /* XCTest.framework */; }; 23 | 5439D25819051C21002C84BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5439D23719051C21002C84BA /* Foundation.framework */; }; 24 | 5439D25919051C21002C84BA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5439D23B19051C21002C84BA /* UIKit.framework */; }; 25 | 5439D26119051C21002C84BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5439D25F19051C21002C84BA /* InfoPlist.strings */; }; 26 | 5439D26319051C21002C84BA /* IntroductionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D26219051C21002C84BA /* IntroductionTests.m */; }; 27 | 5439D27719052C68002C84BA /* ClassAndMethodTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D27619052C68002C84BA /* ClassAndMethodTest.m */; }; 28 | 5439D27A19052E66002C84BA /* UltraObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D27919052E65002C84BA /* UltraObject.m */; }; 29 | 5439D27B19052E66002C84BA /* UltraObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 5439D27919052E65002C84BA /* UltraObject.m */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 5439D25A19051C21002C84BA /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 5439D22C19051C21002C84BA /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 5439D23319051C21002C84BA; 38 | remoteInfo = Introduction; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 542072D71A5BEBB500E5C8F8 /* IntroductionTestsAnswer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IntroductionTestsAnswer.m; sourceTree = ""; }; 44 | 542072D91A5BF4CC00E5C8F8 /* UltraObjectAnswer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UltraObjectAnswer.h; sourceTree = ""; }; 45 | 542072DA1A5BF4CC00E5C8F8 /* UltraObjectAnswer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UltraObjectAnswer.m; sourceTree = ""; }; 46 | 5439D23419051C21002C84BA /* Introduction.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Introduction.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 5439D23719051C21002C84BA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 48 | 5439D23919051C21002C84BA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 49 | 5439D23B19051C21002C84BA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 50 | 5439D23F19051C21002C84BA /* Introduction-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Introduction-Info.plist"; sourceTree = ""; }; 51 | 5439D24119051C21002C84BA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 52 | 5439D24319051C21002C84BA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 53 | 5439D24519051C21002C84BA /* Introduction-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Introduction-Prefix.pch"; sourceTree = ""; }; 54 | 5439D24619051C21002C84BA /* INTAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = INTAppDelegate.h; sourceTree = ""; }; 55 | 5439D24719051C21002C84BA /* INTAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = INTAppDelegate.m; sourceTree = ""; }; 56 | 5439D24A19051C21002C84BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57 | 5439D24C19051C21002C84BA /* INTViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = INTViewController.h; sourceTree = ""; }; 58 | 5439D24D19051C21002C84BA /* INTViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = INTViewController.m; sourceTree = ""; }; 59 | 5439D24F19051C21002C84BA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 60 | 5439D25519051C21002C84BA /* IntroductionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IntroductionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 5439D25619051C21002C84BA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 62 | 5439D25E19051C21002C84BA /* IntroductionTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IntroductionTests-Info.plist"; sourceTree = ""; }; 63 | 5439D26019051C21002C84BA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 64 | 5439D26219051C21002C84BA /* IntroductionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IntroductionTests.m; sourceTree = ""; }; 65 | 5439D27619052C68002C84BA /* ClassAndMethodTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClassAndMethodTest.m; sourceTree = ""; }; 66 | 5439D27819052E65002C84BA /* UltraObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UltraObject.h; sourceTree = ""; }; 67 | 5439D27919052E65002C84BA /* UltraObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UltraObject.m; sourceTree = ""; }; 68 | /* End PBXFileReference section */ 69 | 70 | /* Begin PBXFrameworksBuildPhase section */ 71 | 5439D23119051C21002C84BA /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 5439D23A19051C21002C84BA /* CoreGraphics.framework in Frameworks */, 76 | 5439D23C19051C21002C84BA /* UIKit.framework in Frameworks */, 77 | 5439D23819051C21002C84BA /* Foundation.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | 5439D25219051C21002C84BA /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | 5439D25719051C21002C84BA /* XCTest.framework in Frameworks */, 86 | 5439D25919051C21002C84BA /* UIKit.framework in Frameworks */, 87 | 5439D25819051C21002C84BA /* Foundation.framework in Frameworks */, 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | /* End PBXFrameworksBuildPhase section */ 92 | 93 | /* Begin PBXGroup section */ 94 | 5439D22B19051C21002C84BA = { 95 | isa = PBXGroup; 96 | children = ( 97 | 5439D23D19051C21002C84BA /* Introduction */, 98 | 5439D25C19051C21002C84BA /* IntroductionTests */, 99 | 5439D23619051C21002C84BA /* Frameworks */, 100 | 5439D23519051C21002C84BA /* Products */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 5439D23519051C21002C84BA /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 5439D23419051C21002C84BA /* Introduction.app */, 108 | 5439D25519051C21002C84BA /* IntroductionTests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 5439D23619051C21002C84BA /* Frameworks */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 5439D23719051C21002C84BA /* Foundation.framework */, 117 | 5439D23919051C21002C84BA /* CoreGraphics.framework */, 118 | 5439D23B19051C21002C84BA /* UIKit.framework */, 119 | 5439D25619051C21002C84BA /* XCTest.framework */, 120 | ); 121 | name = Frameworks; 122 | sourceTree = ""; 123 | }; 124 | 5439D23D19051C21002C84BA /* Introduction */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 5439D24F19051C21002C84BA /* Images.xcassets */, 128 | 5439D24619051C21002C84BA /* INTAppDelegate.h */, 129 | 5439D24719051C21002C84BA /* INTAppDelegate.m */, 130 | 5439D24C19051C21002C84BA /* INTViewController.h */, 131 | 5439D24D19051C21002C84BA /* INTViewController.m */, 132 | 5439D24919051C21002C84BA /* Main.storyboard */, 133 | 5439D23E19051C21002C84BA /* Supporting Files */, 134 | 5439D27819052E65002C84BA /* UltraObject.h */, 135 | 5439D27919052E65002C84BA /* UltraObject.m */, 136 | 542072D91A5BF4CC00E5C8F8 /* UltraObjectAnswer.h */, 137 | 542072DA1A5BF4CC00E5C8F8 /* UltraObjectAnswer.m */, 138 | ); 139 | path = Introduction; 140 | sourceTree = ""; 141 | }; 142 | 5439D23E19051C21002C84BA /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 5439D23F19051C21002C84BA /* Introduction-Info.plist */, 146 | 5439D24019051C21002C84BA /* InfoPlist.strings */, 147 | 5439D24319051C21002C84BA /* main.m */, 148 | 5439D24519051C21002C84BA /* Introduction-Prefix.pch */, 149 | ); 150 | name = "Supporting Files"; 151 | sourceTree = ""; 152 | }; 153 | 5439D25C19051C21002C84BA /* IntroductionTests */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 5439D26219051C21002C84BA /* IntroductionTests.m */, 157 | 542072D71A5BEBB500E5C8F8 /* IntroductionTestsAnswer.m */, 158 | 5439D27619052C68002C84BA /* ClassAndMethodTest.m */, 159 | 5439D25D19051C21002C84BA /* Supporting Files */, 160 | ); 161 | path = IntroductionTests; 162 | sourceTree = ""; 163 | }; 164 | 5439D25D19051C21002C84BA /* Supporting Files */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 5439D25E19051C21002C84BA /* IntroductionTests-Info.plist */, 168 | 5439D25F19051C21002C84BA /* InfoPlist.strings */, 169 | ); 170 | name = "Supporting Files"; 171 | sourceTree = ""; 172 | }; 173 | /* End PBXGroup section */ 174 | 175 | /* Begin PBXNativeTarget section */ 176 | 5439D23319051C21002C84BA /* Introduction */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 5439D26619051C21002C84BA /* Build configuration list for PBXNativeTarget "Introduction" */; 179 | buildPhases = ( 180 | 5439D23019051C21002C84BA /* Sources */, 181 | 5439D23119051C21002C84BA /* Frameworks */, 182 | 5439D23219051C21002C84BA /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | ); 188 | name = Introduction; 189 | productName = Introduction; 190 | productReference = 5439D23419051C21002C84BA /* Introduction.app */; 191 | productType = "com.apple.product-type.application"; 192 | }; 193 | 5439D25419051C21002C84BA /* IntroductionTests */ = { 194 | isa = PBXNativeTarget; 195 | buildConfigurationList = 5439D26919051C21002C84BA /* Build configuration list for PBXNativeTarget "IntroductionTests" */; 196 | buildPhases = ( 197 | 5439D25119051C21002C84BA /* Sources */, 198 | 5439D25219051C21002C84BA /* Frameworks */, 199 | 5439D25319051C21002C84BA /* Resources */, 200 | ); 201 | buildRules = ( 202 | ); 203 | dependencies = ( 204 | 5439D25B19051C21002C84BA /* PBXTargetDependency */, 205 | ); 206 | name = IntroductionTests; 207 | productName = IntroductionTests; 208 | productReference = 5439D25519051C21002C84BA /* IntroductionTests.xctest */; 209 | productType = "com.apple.product-type.bundle.unit-test"; 210 | }; 211 | /* End PBXNativeTarget section */ 212 | 213 | /* Begin PBXProject section */ 214 | 5439D22C19051C21002C84BA /* Project object */ = { 215 | isa = PBXProject; 216 | attributes = { 217 | CLASSPREFIX = INT; 218 | LastUpgradeCheck = 0510; 219 | ORGANIZATIONNAME = "mixi, Inc"; 220 | TargetAttributes = { 221 | 5439D25419051C21002C84BA = { 222 | TestTargetID = 5439D23319051C21002C84BA; 223 | }; 224 | }; 225 | }; 226 | buildConfigurationList = 5439D22F19051C21002C84BA /* Build configuration list for PBXProject "Introduction" */; 227 | compatibilityVersion = "Xcode 3.2"; 228 | developmentRegion = English; 229 | hasScannedForEncodings = 0; 230 | knownRegions = ( 231 | en, 232 | Base, 233 | ); 234 | mainGroup = 5439D22B19051C21002C84BA; 235 | productRefGroup = 5439D23519051C21002C84BA /* Products */; 236 | projectDirPath = ""; 237 | projectRoot = ""; 238 | targets = ( 239 | 5439D23319051C21002C84BA /* Introduction */, 240 | 5439D25419051C21002C84BA /* IntroductionTests */, 241 | ); 242 | }; 243 | /* End PBXProject section */ 244 | 245 | /* Begin PBXResourcesBuildPhase section */ 246 | 5439D23219051C21002C84BA /* Resources */ = { 247 | isa = PBXResourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | 5439D25019051C21002C84BA /* Images.xcassets in Resources */, 251 | 5439D24219051C21002C84BA /* InfoPlist.strings in Resources */, 252 | 5439D24B19051C21002C84BA /* Main.storyboard in Resources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | 5439D25319051C21002C84BA /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | 5439D26119051C21002C84BA /* InfoPlist.strings in Resources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | /* End PBXResourcesBuildPhase section */ 265 | 266 | /* Begin PBXSourcesBuildPhase section */ 267 | 5439D23019051C21002C84BA /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 5439D27A19052E66002C84BA /* UltraObject.m in Sources */, 272 | 5439D24E19051C21002C84BA /* INTViewController.m in Sources */, 273 | 5439D24819051C21002C84BA /* INTAppDelegate.m in Sources */, 274 | 5439D24419051C21002C84BA /* main.m in Sources */, 275 | 542072DB1A5BF4CC00E5C8F8 /* UltraObjectAnswer.m in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 5439D25119051C21002C84BA /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 5439D26319051C21002C84BA /* IntroductionTests.m in Sources */, 284 | 542072D81A5BEBB500E5C8F8 /* IntroductionTestsAnswer.m in Sources */, 285 | 5439D27719052C68002C84BA /* ClassAndMethodTest.m in Sources */, 286 | 5439D27B19052E66002C84BA /* UltraObject.m in Sources */, 287 | 542072DC1A5BF4FD00E5C8F8 /* UltraObjectAnswer.m in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXSourcesBuildPhase section */ 292 | 293 | /* Begin PBXTargetDependency section */ 294 | 5439D25B19051C21002C84BA /* PBXTargetDependency */ = { 295 | isa = PBXTargetDependency; 296 | target = 5439D23319051C21002C84BA /* Introduction */; 297 | targetProxy = 5439D25A19051C21002C84BA /* PBXContainerItemProxy */; 298 | }; 299 | /* End PBXTargetDependency section */ 300 | 301 | /* Begin PBXVariantGroup section */ 302 | 5439D24019051C21002C84BA /* InfoPlist.strings */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | 5439D24119051C21002C84BA /* en */, 306 | ); 307 | name = InfoPlist.strings; 308 | sourceTree = ""; 309 | }; 310 | 5439D24919051C21002C84BA /* Main.storyboard */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | 5439D24A19051C21002C84BA /* Base */, 314 | ); 315 | name = Main.storyboard; 316 | sourceTree = ""; 317 | }; 318 | 5439D25F19051C21002C84BA /* InfoPlist.strings */ = { 319 | isa = PBXVariantGroup; 320 | children = ( 321 | 5439D26019051C21002C84BA /* en */, 322 | ); 323 | name = InfoPlist.strings; 324 | sourceTree = ""; 325 | }; 326 | /* End PBXVariantGroup section */ 327 | 328 | /* Begin XCBuildConfiguration section */ 329 | 5439D26419051C21002C84BA /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 334 | CLANG_CXX_LIBRARY = "libc++"; 335 | CLANG_ENABLE_MODULES = YES; 336 | CLANG_ENABLE_OBJC_ARC = YES; 337 | CLANG_WARN_BOOL_CONVERSION = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 340 | CLANG_WARN_EMPTY_BODY = YES; 341 | CLANG_WARN_ENUM_CONVERSION = YES; 342 | CLANG_WARN_INT_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 345 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 346 | COPY_PHASE_STRIP = NO; 347 | GCC_C_LANGUAGE_STANDARD = gnu99; 348 | GCC_DYNAMIC_NO_PIC = NO; 349 | GCC_OPTIMIZATION_LEVEL = 0; 350 | GCC_PREPROCESSOR_DEFINITIONS = ( 351 | "DEBUG=1", 352 | "$(inherited)", 353 | ); 354 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 355 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 357 | GCC_WARN_UNDECLARED_SELECTOR = YES; 358 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 359 | GCC_WARN_UNUSED_FUNCTION = YES; 360 | GCC_WARN_UNUSED_VARIABLE = YES; 361 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 362 | ONLY_ACTIVE_ARCH = YES; 363 | SDKROOT = iphoneos; 364 | }; 365 | name = Debug; 366 | }; 367 | 5439D26519051C21002C84BA /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 372 | CLANG_CXX_LIBRARY = "libc++"; 373 | CLANG_ENABLE_MODULES = YES; 374 | CLANG_ENABLE_OBJC_ARC = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_CONSTANT_CONVERSION = YES; 377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 378 | CLANG_WARN_EMPTY_BODY = YES; 379 | CLANG_WARN_ENUM_CONVERSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 383 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 384 | COPY_PHASE_STRIP = YES; 385 | ENABLE_NS_ASSERTIONS = NO; 386 | GCC_C_LANGUAGE_STANDARD = gnu99; 387 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 388 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 389 | GCC_WARN_UNDECLARED_SELECTOR = YES; 390 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 391 | GCC_WARN_UNUSED_FUNCTION = YES; 392 | GCC_WARN_UNUSED_VARIABLE = YES; 393 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 394 | SDKROOT = iphoneos; 395 | VALIDATE_PRODUCT = YES; 396 | }; 397 | name = Release; 398 | }; 399 | 5439D26719051C21002C84BA /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 403 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 404 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 405 | GCC_PREFIX_HEADER = "Introduction/Introduction-Prefix.pch"; 406 | INFOPLIST_FILE = "Introduction/Introduction-Info.plist"; 407 | PRODUCT_NAME = "$(TARGET_NAME)"; 408 | WRAPPER_EXTENSION = app; 409 | }; 410 | name = Debug; 411 | }; 412 | 5439D26819051C21002C84BA /* Release */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 416 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 417 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 418 | GCC_PREFIX_HEADER = "Introduction/Introduction-Prefix.pch"; 419 | INFOPLIST_FILE = "Introduction/Introduction-Info.plist"; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | WRAPPER_EXTENSION = app; 422 | }; 423 | name = Release; 424 | }; 425 | 5439D26A19051C21002C84BA /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Introduction.app/Introduction"; 429 | FRAMEWORK_SEARCH_PATHS = ( 430 | "$(SDKROOT)/Developer/Library/Frameworks", 431 | "$(inherited)", 432 | "$(DEVELOPER_FRAMEWORKS_DIR)", 433 | ); 434 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 435 | GCC_PREFIX_HEADER = "Introduction/Introduction-Prefix.pch"; 436 | GCC_PREPROCESSOR_DEFINITIONS = ( 437 | "DEBUG=1", 438 | "$(inherited)", 439 | ); 440 | INFOPLIST_FILE = "IntroductionTests/IntroductionTests-Info.plist"; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | TEST_HOST = "$(BUNDLE_LOADER)"; 443 | WRAPPER_EXTENSION = xctest; 444 | }; 445 | name = Debug; 446 | }; 447 | 5439D26B19051C21002C84BA /* Release */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Introduction.app/Introduction"; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(SDKROOT)/Developer/Library/Frameworks", 453 | "$(inherited)", 454 | "$(DEVELOPER_FRAMEWORKS_DIR)", 455 | ); 456 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 457 | GCC_PREFIX_HEADER = "Introduction/Introduction-Prefix.pch"; 458 | INFOPLIST_FILE = "IntroductionTests/IntroductionTests-Info.plist"; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | TEST_HOST = "$(BUNDLE_LOADER)"; 461 | WRAPPER_EXTENSION = xctest; 462 | }; 463 | name = Release; 464 | }; 465 | /* End XCBuildConfiguration section */ 466 | 467 | /* Begin XCConfigurationList section */ 468 | 5439D22F19051C21002C84BA /* Build configuration list for PBXProject "Introduction" */ = { 469 | isa = XCConfigurationList; 470 | buildConfigurations = ( 471 | 5439D26419051C21002C84BA /* Debug */, 472 | 5439D26519051C21002C84BA /* Release */, 473 | ); 474 | defaultConfigurationIsVisible = 0; 475 | defaultConfigurationName = Release; 476 | }; 477 | 5439D26619051C21002C84BA /* Build configuration list for PBXNativeTarget "Introduction" */ = { 478 | isa = XCConfigurationList; 479 | buildConfigurations = ( 480 | 5439D26719051C21002C84BA /* Debug */, 481 | 5439D26819051C21002C84BA /* Release */, 482 | ); 483 | defaultConfigurationIsVisible = 0; 484 | defaultConfigurationName = Release; 485 | }; 486 | 5439D26919051C21002C84BA /* Build configuration list for PBXNativeTarget "IntroductionTests" */ = { 487 | isa = XCConfigurationList; 488 | buildConfigurations = ( 489 | 5439D26A19051C21002C84BA /* Debug */, 490 | 5439D26B19051C21002C84BA /* Release */, 491 | ); 492 | defaultConfigurationIsVisible = 0; 493 | defaultConfigurationName = Release; 494 | }; 495 | /* End XCConfigurationList section */ 496 | }; 497 | rootObject = 5439D22C19051C21002C84BA /* Project object */; 498 | } 499 | -------------------------------------------------------------------------------- /Introduction.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Introduction.xcodeproj/xcuserdata/yuichi.takeda.xcuserdatad/xcschemes/Introduction.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Introduction.xcodeproj/xcuserdata/yuichi.takeda.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Introduction.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 5439D23319051C21002C84BA 16 | 17 | primary 18 | 19 | 20 | 5439D25419051C21002C84BA 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Introduction/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Introduction/INTAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // INTAppDelegate.h 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface INTAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Introduction/INTAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // INTAppDelegate.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import "INTAppDelegate.h" 10 | 11 | @implementation INTAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Introduction/INTViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // INTViewController.h 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface INTViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Introduction/INTViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // INTViewController.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import "INTViewController.h" 10 | 11 | @interface INTViewController () 12 | 13 | @end 14 | 15 | @implementation INTViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Introduction/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Introduction/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Introduction/Introduction-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | mixi.${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 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Introduction/Introduction-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Introduction/UltraObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // UltraObject.h 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UltraObject : NSObject 12 | 13 | // プロパティ(インスタンス変数の定義) 14 | @property (nonatomic, strong) NSString *name; 15 | @property (nonatomic, assign) NSInteger ultra; 16 | 17 | // クラスメソッドの宣言 18 | + (void)myClassMethod; 19 | 20 | // インスタンスメソッドの宣言 21 | - (void)myInstanceMethod; 22 | 23 | 24 | - (NSString *)ultraString; 25 | - (void)doubleUltra; 26 | 27 | 28 | // イニシャライザを独自定義する時はinitWith...とするのが習わし 29 | - (instancetype)initWithName:(NSString *)str ultra:(NSInteger)ultra; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Introduction/UltraObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // UltraObject.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import "UltraObject.h" 10 | 11 | @implementation UltraObject 12 | 13 | - (instancetype)init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | // ここに初期化の処理を書くのが習わし 18 | } 19 | return self; 20 | } 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Introduction/UltraObjectAnswer.h: -------------------------------------------------------------------------------- 1 | // 2 | // UltraObjectAnswer.h 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 1/6/15. 6 | // Copyright (c) 2015 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UltraObjectAnswer : NSObject 12 | 13 | // プロパティ(インスタンス変数の定義) 14 | @property (nonatomic, strong) NSString *name; 15 | @property (nonatomic, assign) NSInteger ultra; 16 | 17 | // クラスメソッドの宣言 18 | + (void)myClassMethod; 19 | 20 | // インスタンスメソッドの宣言 21 | - (void)myInstanceMethod; 22 | 23 | 24 | - (NSString *)ultraString; 25 | - (void)doubleUltra; 26 | 27 | 28 | // イニシャライザを独自定義する時はinitWith...とするのが習わし 29 | - (instancetype)initWithName:(NSString *)str ultra:(NSInteger)ultra; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Introduction/UltraObjectAnswer.m: -------------------------------------------------------------------------------- 1 | // 2 | // UltraObjectAnswer.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 1/6/15. 6 | // Copyright (c) 2015 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import "UltraObjectAnswer.h" 10 | 11 | @implementation UltraObjectAnswer 12 | 13 | - (instancetype)init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | // ここに初期化の処理を書くのが習わし 18 | } 19 | return self; 20 | } 21 | 22 | - (instancetype)initWithName:(NSString *)str ultra:(NSInteger)ultra 23 | { 24 | self = [self init]; 25 | if (self) { 26 | _name = str; 27 | _ultra = ultra; 28 | } 29 | return self; 30 | } 31 | 32 | - (NSString *)ultraString 33 | { 34 | return [NSString stringWithFormat:@"Ultra-%@-%ld", self.name, self.ultra]; 35 | } 36 | 37 | - (void)doubleUltra 38 | { 39 | self.ultra *= 2; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Introduction/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Introduction/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "INTAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([INTAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /IntroductionTests/ClassAndMethodTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // ClassAndMethodTest.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "UltraObject.h" 12 | 13 | @interface ClassAndMethodTest : XCTestCase 14 | 15 | @end 16 | 17 | @implementation ClassAndMethodTest 18 | 19 | - (void)setUp 20 | { 21 | [super setUp]; 22 | // Put setup code here. This method is called before the invocation of each test method in the class. 23 | } 24 | 25 | - (void)tearDown 26 | { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | [super tearDown]; 29 | } 30 | 31 | - (void)testInitialize 32 | { 33 | // 問題 34 | // UltraObject.m にはメソッド initWithName:ultra: が実装されていないので実装してください 35 | // この時、引数として渡されたnameとultraがそれぞれプロパティnameとultraにセットされるようにして下さい 36 | UltraObject *ultraObj = [[UltraObject alloc] initWithName:@"seven" ultra:7]; 37 | XCTAssertTrue([ultraObj.name isEqualToString:@"seven"], @""); 38 | XCTAssertEqual(ultraObj.ultra, 7, @""); 39 | } 40 | 41 | - (void)testUltraString 42 | { 43 | UltraObject *ultraObj = [[UltraObject alloc] initWithName:@"seven" ultra:7]; 44 | 45 | // 問題 46 | // UltraObject.m にはメソッド ultraString が実装されていないので実装して下さい 47 | // ultraStringはそのインスタンスのプロパティnameとultraを用いて 48 | // Ultra-name-ultra というNSStringを返すメソッドです 49 | XCTAssertTrue([[ultraObj ultraString] isEqualToString:@"Ultra-seven-7"], @"ヒント : [NSString stringWithFormat:...] を使う"); 50 | 51 | UltraObject *ultraEight = [[UltraObject alloc] initWithName:@"eight" ultra:8]; 52 | XCTAssertTrue([[ultraEight ultraString] isEqualToString:@"Ultra-eight-8"], @""); 53 | 54 | } 55 | 56 | - (void)testDoubleUltra 57 | { 58 | UltraObject *ultraObj = [[UltraObject alloc] initWithName:@"seven" ultra:7]; 59 | 60 | // 問題 61 | // UltraObject.m にはメソッド doubleUltra が実装されていないので実装して下さい 62 | // doubleUltraはインスタンスのプロパティultra を2倍にするメソッドです 63 | XCTAssertEqual(ultraObj.ultra, 7, @""); 64 | [ultraObj doubleUltra]; 65 | XCTAssertEqual(ultraObj.ultra, 14, @""); 66 | [ultraObj doubleUltra]; 67 | XCTAssertEqual(ultraObj.ultra, 28, @""); 68 | 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /IntroductionTests/IntroductionTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | mixi.${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 | -------------------------------------------------------------------------------- /IntroductionTests/IntroductionTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IntroductionTests.m 3 | // IntroductionTests 4 | // 5 | // Created by yuichi.takeda on 4/21/14. 6 | // Copyright (c) 2014 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IntroductionTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation IntroductionTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | #pragma mark - NSString 30 | - (void)testCreateNSString 31 | { 32 | // 問題 33 | // 変数 str に文字列"Hello, World!!" を代入してください 34 | NSString *str; 35 | XCTAssertTrue([str isEqualToString:@"Hello, World!!"], @"Objective-Cの文字列は@とダブルクォーテーションでくくって作ります。"); 36 | XCTAssertEqual(str.length, 14, @"長さの取得はlengthメソッド"); 37 | 38 | // 問題 39 | // stringWithFormatのフォーマットをテストが通るように整形してください 40 | NSString *formatted = [NSString stringWithFormat:@"int:%lf, float:%x, obj:%@", 10, 30.0, str]; 41 | XCTAssertTrue([formatted isEqualToString:@"int:10, float:30.000000, obj:Hello, World!!"], @"フォーマット指定子も使えます。Objective-Cのオブジェクトは%@で出力できます"); 42 | 43 | } 44 | 45 | - (void)testAppendNSMutableString 46 | { 47 | // 問題 48 | // 変数 mutableString に文字列を追加して "Hello, World" となるようにしてください 49 | NSMutableString *mutableString = [NSMutableString stringWithString:@"Hello, "]; 50 | XCTAssertTrue([mutableString isEqualToString:@"Hello, World"], @"文字列の結合にはappendStringを使う"); 51 | } 52 | 53 | 54 | #pragma mark - NSArray 55 | - (void)testNSArrayBasics 56 | { 57 | // 問題 58 | // 変数 array の 0番目,1番目,2番目 の要素がそれぞれ str1, str2, str3 になるようにしてください 59 | NSString *str1 = @"1", *str2 = @"2", *str3 = @"3"; 60 | NSArray *array; 61 | 62 | XCTAssertEqualObjects(array[0], str1, @"配列は@[..]で作って、アクセスはarray[0]のようにします。"); 63 | XCTAssertEqual(array.count, 3, @"配列のサイズへのアクセスは.countを利用"); 64 | 65 | /* 66 | NSArrayはインスタンス生成後は追加や削除ができないImmutableクラス 67 | 後から変更を加える場合はNSMutableArrayを使う 68 | */ 69 | NSMutableArray *mutable = [NSMutableArray array]; 70 | XCTAssertEqual(mutable.count, 0, @"最初は0個"); 71 | 72 | // 問題 73 | // 変数 mutable にstr1 を追加してください 74 | XCTAssertEqualObjects(mutable[0], str1, @"オブジェクトを追加するにはaddObjectを利用する"); 75 | 76 | // 問題 77 | // 続いて変数 mutable に str2, str3 をまとめて追加してください 78 | XCTAssertEqual(mutable.count, 3, @"まとめて追加するときはaddObjectsFromArrayを利用"); 79 | 80 | // 問題 81 | // mutableの最初の変数を削除してください 82 | XCTAssertEqualObjects(mutable[1], str3, @"削除するときはremoveObject...なメソッドを利用"); 83 | 84 | } 85 | 86 | #pragma mark - NSDictionary 87 | - (void)testNSDictionaryBasics 88 | { 89 | // 問題 90 | // NSDictionary型の変数 dict を キー : @"key" で @"value" が返ってくるように初期化してください 91 | NSDictionary *dict; 92 | XCTAssertEqualObjects(dict[@"key"], @"value", @"辞書型のNSDictionaryは @{key:value} のように初期化し、dict[key]のようにアクセスします"); 93 | XCTAssertNil(dict[@"foobar"], @"登録していない場合はnilが返ります。"); 94 | XCTAssertTrue([dict.allKeys[0] isEqualToString:@"key"], @"全てのキーはallKeysで取れます。NSArrayが帰ってきます。"); 95 | XCTAssertTrue([dict.allValues[0] isEqualToString:@"value"], @"全ての値はallValuesで取れます。NSArrayが帰ってきます。"); 96 | 97 | 98 | /* 99 | NSArrayと同様にNSDictionaryも変更不可能なImmutableなクラスです 100 | 後から変更する場合はNSMutableDictionaryを使います。 101 | */ 102 | 103 | NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; 104 | NSString *str = @"I love ruby"; 105 | 106 | // 問題 107 | // mutableDictにキー : @"key"で str が返るようにオブジェクトを追加してください 108 | XCTAssertEqualObjects(mutableDict[@"key"], str, @"dict[key] = valueで登録できます。"); 109 | 110 | // 問題 111 | // mutableDictに同じキー @"key"で st2 が返るように上書きしてください 112 | NSString *str2 = @"I love Objective-C"; 113 | XCTAssertEqualObjects(mutableDict[@"key"], str2, @"同じキーで代入すると上書きされます。"); 114 | 115 | // 問題 116 | // mutableDictからキー @"key" で登録されているオブジェクトを削除してください 117 | XCTAssertNil(mutableDict[@"key"], @"removeObjectForKeyで削除されます。"); 118 | 119 | } 120 | 121 | 122 | #pragma mark control syntax 123 | /* 124 | 制御構文はC言語のものを基本的に使います。 125 | 一部、Obj-Cの拡張もあります。 126 | */ 127 | 128 | - (void)testIfAndBOOL 129 | { 130 | //真偽値ではBOOL型を使う事が一般的です。 131 | BOOL a; 132 | if (a == YES) { // 比較は '==' を使います。オブジェクトの比較には isEqual: を使います。 133 | // ここに来て欲しい 134 | } else { 135 | XCTFail(@"ここに来ちゃダメ"); 136 | } 137 | 138 | 139 | BOOL b; 140 | if (!b) { // '!' は反転演算 141 | XCTFail(@"ここに来ちゃダメ"); 142 | } 143 | 144 | 145 | if (nil) { 146 | // nil は真偽値的には NO になる 147 | } 148 | 149 | } 150 | 151 | - (void)testFor 152 | { 153 | // 問題 154 | // 以下のfor文を書き換えてcount1が10回インクリメントするようにしてください 155 | NSInteger count1 = 0; 156 | for (; count1 < 10;) { 157 | // break;の行を削除して、ここにコードを書く 158 | break; 159 | } 160 | 161 | XCTAssertEqual(count1, 10, @"Cのfor文をかける"); 162 | 163 | // for-in という高速列挙も利用可能でこちらのほうが利用される 164 | NSArray *array = @[@"a", @"b", @"c"]; 165 | for (NSString *str in array) { 166 | NSLog(@"%@", str); 167 | } 168 | 169 | 170 | NSMutableArray *mutableArray; 171 | 172 | 173 | // 問題 174 | // 以下のforを使ってmutableArrayに0から9のNSNumberを追加してみてください 175 | // NSNumberは @(i) で作ることができます 176 | for (NSInteger i = 0; i < 10; ++i) { 177 | NSNumber *num = mutableArray[i]; 178 | XCTAssertTrue([num isKindOfClass:[NSNumber class]], @""); 179 | XCTAssertEqual(num.integerValue, i, @""); 180 | } 181 | 182 | 183 | } 184 | 185 | #pragma mark - Others 186 | - (void)testNil 187 | { 188 | NSObject *obj = nil; 189 | XCTAssertNoThrow([obj description], @"nilなものにメソッドを投げてもヌルポは飛ばない"); 190 | 191 | NSNull *null = [NSNull null]; 192 | XCTAssertNotNil(null, @"Nullであることを明示するNSNUllというクラスもあります"); 193 | 194 | XCTAssertThrows(@{@"key": obj}, @"NSArrayやNSDictionaryにnilを入れる事はできません"); 195 | 196 | } 197 | 198 | - (void)testNSNumber 199 | { 200 | /* 201 | 数を表すクラスにNSNumberがあります。プリミティブに対するラップなので使用頻度は少ないです。 202 | */ 203 | NSNumber *num = @10; 204 | XCTAssertEqual(num.integerValue, 10, @""); 205 | 206 | } 207 | 208 | @end 209 | -------------------------------------------------------------------------------- /IntroductionTests/IntroductionTestsAnswer.m: -------------------------------------------------------------------------------- 1 | // 2 | // IntroductionTestsAnswer.m 3 | // Introduction 4 | // 5 | // Created by yuichi.takeda on 1/6/15. 6 | // Copyright (c) 2015 mixi, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface IntroductionTestsAnswer : XCTestCase 13 | 14 | @end 15 | 16 | @implementation IntroductionTestsAnswer 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | #pragma mark - NSString 30 | - (void)testCreateNSString 31 | { 32 | // 問題 33 | // 変数 str に文字列"Hello, World!!" を代入してください 34 | NSString *str = @"Hello, World!!"; 35 | XCTAssertTrue([str isEqualToString:@"Hello, World!!"], @"Objective-Cの文字列は@とダブルクォーテーションでくくって作ります。"); 36 | XCTAssertEqual(str.length, 14, @"長さの取得はlengthメソッド"); 37 | 38 | // 問題 39 | // stringWithFormatのフォーマットをテストが通るように整形してください 40 | NSString *formatted = [NSString stringWithFormat:@"int:%d, float:%f, obj:%@", 10, 30.0, str]; 41 | XCTAssertTrue([formatted isEqualToString:@"int:10, float:30.000000, obj:Hello, World!!"], @"フォーマット指定子も使えます。Objective-Cのオブジェクトは%@で出力できます"); 42 | 43 | } 44 | 45 | - (void)testAppendNSMutableString 46 | { 47 | // 問題 48 | // 変数 mutableString に文字列を追加して "Hello, World" となるようにしてください 49 | NSMutableString *mutableString = [NSMutableString stringWithString:@"Hello, "]; 50 | [mutableString appendString:@"World"]; 51 | XCTAssertTrue([mutableString isEqualToString:@"Hello, World"], @"文字列の結合にはappendStringを使う"); 52 | } 53 | 54 | 55 | #pragma mark - NSArray 56 | - (void)testNSArrayBasics 57 | { 58 | // 問題 59 | // 変数 array の 0番目,1番目,2番目 の要素がそれぞれ str1, str2, str3 になるようにしてください 60 | NSString *str1 = @"1", *str2 = @"2", *str3 = @"3"; 61 | NSArray *array = @[str1, str2, str3]; 62 | 63 | XCTAssertEqualObjects(array[0], str1, @"配列は@[..]で作って、アクセスはarray[0]のようにします。"); 64 | XCTAssertEqual(array.count, 3, @"配列のサイズへのアクセスは.countを利用"); 65 | 66 | /* 67 | NSArrayはインスタンス生成後は追加や削除ができないImmutableクラス 68 | 後から変更を加える場合はNSMutableArrayを使う 69 | */ 70 | NSMutableArray *mutable = [NSMutableArray array]; 71 | XCTAssertEqual(mutable.count, 0, @"最初は0個"); 72 | 73 | // 問題 74 | // 変数 mutable にstr1 を追加してください 75 | [mutable addObject:str1]; 76 | XCTAssertEqualObjects(mutable[0], str1, @"オブジェクトを追加するにはaddObjectを利用する"); 77 | 78 | // 問題 79 | // 続いて変数 mutable に str2, str3 をまとめて追加してください 80 | [mutable addObjectsFromArray:@[str2, str3]]; 81 | XCTAssertEqual(mutable.count, 3, @"まとめて追加するときはaddObjectsFromArrayを利用"); 82 | 83 | // 問題 84 | // mutableの最初の変数を削除してください 85 | [mutable removeObjectAtIndex:0]; 86 | XCTAssertEqualObjects(mutable[1], str3, @"削除するときはremoveObject...なメソッドを利用"); 87 | // 補足 88 | // [mutable removeObject:str1]; でも可能 89 | } 90 | 91 | #pragma mark - NSDictionary 92 | - (void)testNSDictionaryBasics 93 | { 94 | // 問題 95 | // NSDictionary型の変数 dict を キー : @"key" で @"value" が返ってくるように初期化してください 96 | NSDictionary *dict = @{@"key": @"value"}; 97 | XCTAssertEqualObjects(dict[@"key"], @"value", @"辞書型のNSDictionaryは @{key:value} のように初期化し、dict[key]のようにアクセスします"); 98 | XCTAssertNil(dict[@"foobar"], @"登録していない場合はnilが返ります。"); 99 | XCTAssertTrue([dict.allKeys[0] isEqualToString:@"key"], @"全てのキーはallKeysで取れます。NSArrayが帰ってきます。"); 100 | XCTAssertTrue([dict.allValues[0] isEqualToString:@"value"], @"全ての値はallValuesで取れます。NSArrayが帰ってきます。"); 101 | 102 | 103 | /* 104 | NSArrayと同様にNSDictionaryも変更不可能なImmutableなクラスです 105 | 後から変更する場合はNSMutableDictionaryを使います。 106 | */ 107 | 108 | NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; 109 | NSString *str = @"I love ruby"; 110 | 111 | // 問題 112 | // mutableDictにキー : @"key"で str が返るようにオブジェクトを追加してください 113 | mutableDict[@"key"] = str; 114 | XCTAssertEqualObjects(mutableDict[@"key"], str, @"dict[key] = valueで登録できます。"); 115 | 116 | // 問題 117 | // mutableDictに同じキー @"key"で st2 が返るように上書きしてください 118 | NSString *str2 = @"I love Objective-C"; 119 | mutableDict[@"key"] = str2; 120 | XCTAssertEqualObjects(mutableDict[@"key"], str2, @"同じキーで代入すると上書きされます。"); 121 | 122 | // 問題 123 | // mutableDictからキー @"key" で登録されているオブジェクトを削除してください 124 | [mutableDict removeObjectForKey:@"key"]; 125 | XCTAssertNil(mutableDict[@"key"], @"removeObjectForKeyで削除されます。"); 126 | 127 | } 128 | 129 | 130 | #pragma mark control syntax 131 | /* 132 | 制御構文はC言語のものを基本的に使います。 133 | 一部、Obj-Cの拡張もあります。 134 | */ 135 | 136 | - (void)testIfAndBOOL 137 | { 138 | //真偽値ではBOOL型を使う事が一般的です。 139 | BOOL a = YES; 140 | if (a == YES) { // 比較は '==' を使います。オブジェクトの比較には isEqual: を使います。 141 | // ここに来て欲しい 142 | } else { 143 | XCTFail(@"ここに来ちゃダメ"); 144 | } 145 | 146 | 147 | BOOL b = YES; 148 | if (!b) { // '!' は反転演算 149 | XCTFail(@"ここに来ちゃダメ"); 150 | } 151 | 152 | 153 | if (nil) { 154 | // nil は真偽値的には NO になる 155 | } 156 | 157 | } 158 | 159 | - (void)testFor 160 | { 161 | // 問題 162 | // 以下のfor文を書き換えてcount1が10回インクリメントするようにしてください 163 | NSInteger count1 = 0; 164 | for (; count1 < 10;) { 165 | count1++; 166 | } 167 | 168 | XCTAssertEqual(count1, 10, @"Cのfor文をかける"); 169 | 170 | // for-in という高速列挙も利用可能でこちらのほうが利用される 171 | NSArray *array = @[@"a", @"b", @"c"]; 172 | for (NSString *str in array) { 173 | NSLog(@"%@", str); 174 | } 175 | 176 | 177 | NSMutableArray *mutableArray = [NSMutableArray array]; 178 | 179 | 180 | // 問題 181 | // 以下のforを使ってmutableArrayに0から9のNSNumberを追加してみてください 182 | // NSNumberは @(i) で作ることができます 183 | for (NSInteger i = 0; i < 10; ++i) { 184 | [mutableArray addObject:@(i)]; 185 | NSNumber *num = mutableArray[i]; 186 | NSLog(@"%@", [num class]); 187 | XCTAssertTrue([num isKindOfClass:[NSNumber class]], @""); 188 | XCTAssertEqual(num.integerValue, i, @""); 189 | } 190 | 191 | 192 | } 193 | 194 | #pragma mark - Others 195 | - (void)testNil 196 | { 197 | NSObject *obj = nil; 198 | XCTAssertNoThrow([obj description], @"nilなものにメソッドを投げてもヌルポは飛ばない"); 199 | 200 | NSNull *null = [NSNull null]; 201 | XCTAssertNotNil(null, @"Nullであることを明示するNSNUllというクラスもあります"); 202 | 203 | XCTAssertThrows(@{@"key": obj}, @"NSArrayやNSDictionaryにnilを入れる事はできません"); 204 | 205 | } 206 | 207 | - (void)testNSNumber 208 | { 209 | /* 210 | 数を表すクラスにNSNumberがあります。プリミティブに対するラップなので使用頻度は少ないです。 211 | */ 212 | NSNumber *num = @10; 213 | XCTAssertEqual(num.integerValue, 10, @""); 214 | 215 | } 216 | @end 217 | -------------------------------------------------------------------------------- /IntroductionTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | introduction-for-objective-c 2 | ============================ 3 | 4 | Objective-Cの文法に慣れるためのコード置き場 5 | 6 | 7 | ## 構成 8 | * Hello, Worldと表示されるだけのアプリケーション 9 | * Objective-Cの基本的なクラスや文法に慣れるためのテスト (IntroductionTests.m) 10 | * Objective-Cのクラスやメソッドの宣言、定義などを覚えるためのクラス(UltraObject)とそのテスト(ClassAndMethodTest.m) 11 | 12 | 13 | ## Xcodeの起動を確認 14 | まずは Introduction.xcodeproj を開いてXcodeが起動する事を確認します。 15 | 次に左上の三角形(▶︎)を押すとシミュレータが立ち上がるかを確認してください。 16 | 次に、コマンド(⌘)+Uでテストを実行してください。たくさんテストがこけると思います。このテストが通るように直して行く事でObjective-Cの基本を学んで行ってもらおうというのがこのリポジトリの趣旨となります。 17 | 18 | 19 | ## Objective-Cの基本的なクラスや文法について (IntroductionTests.m) 20 | IntroductionTests.mを直して全てのテストが通るようにしてください。 21 | テストコード(XCTプレフィックスのついているもの)には手を加えないでください。 22 | XCテストケースの解説の箇所にヒントが書いてあります。 23 | ここで扱う項目は以下になります。 24 | 25 | * NSString / NSMutableString 26 | * NSArray / NSMutableArray 27 | * NSDictionary / NSMutableDictionary 28 | * 制御構文 29 | * ifとBOOL型 30 | * for文 31 | * nilとNSNull 32 | * NSNumber 33 | 34 | whileやswitch-caseなども使えますがここでは飛ばしています。 35 | またカバー出来ていないFoundation.frameworkのクラスもあります。 36 | 37 | 困った時は、コマンド(⌘) + shift + 0 (ゼロ)でドキュメントのウィンドウが立ち上がります。 38 | 調べたいクラスについて検索するとヒントが見つかります。 39 | 40 | 41 | ## Objective-Cのクラス定義やメソッドの実装について 42 | UltraObjectというクラスを作っています。また対応するテストとしてClassAndMethodTest.m というテストも作っています。 43 | 44 | UltraObject.hに書いたけど実装していないメソッドがあります。そのメソッドを実装してテストが通るようにしてください。 45 | 46 | 47 | 48 | 49 | 50 | --------------------------------------------------------------------------------