├── .gitignore ├── Copy-Strong-Array-MutableArray ├── Copy-Strong-Array-MutableArray.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Copy-Strong-Array-MutableArray │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Copy-Strong-Array-MutableArrayTests │ ├── Copy_Strong_Array_MutableArrayTests.m │ └── Info.plist ├── Copy-Strong-Array-MutableArrayUITests │ ├── Copy_Strong_Array_MutableArrayUITests.m │ └── Info.plist └── README.md ├── LICENSE ├── Load+Initialize ├── Load+Initialize.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcuserdata │ │ └── mjpc.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── Load+Initialize.xcscheme │ │ └── xcschememanagement.plist ├── Load+Initialize │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Father.h │ ├── Father.m │ ├── Info.plist │ ├── Other+initialize.h │ ├── Other+initialize.m │ ├── Other.h │ ├── Other.m │ ├── Son+load.h │ ├── Son+load.m │ ├── Son.h │ ├── Son.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Load+InitializeTests │ ├── Info.plist │ └── Load_InitializeTests.m └── Load+InitializeUITests │ ├── Info.plist │ └── Load_InitializeUITests.m ├── LockPerformance ├── LockPerformance.jpg ├── LockPerformance.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── LockPerformance │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── LockPerformanceTests │ ├── Info.plist │ └── LockPerformanceTests.m ├── LockPerformanceUITests │ ├── Info.plist │ └── LockPerformanceUITests.m └── README.md ├── MLDescription ├── NSObject+MLDescription.h ├── NSObject+MLDescription.m └── README.md ├── MessageForwarding ├── MessageForwarding.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── MessageForwarding │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Bird.h │ ├── Bird.m │ ├── Info.plist │ ├── Monkey.h │ ├── Monkey.m │ ├── People.h │ ├── People.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── MessageForwardingTests │ ├── Info.plist │ └── MessageForwardingTests.m ├── MessageForwardingUITests │ ├── Info.plist │ └── MessageForwardingUITests.m └── README.md ├── README.md └── TestRefresh1 ├── Podfile ├── TestRefresh1.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── TestRefresh1.xcworkspace └── contents.xcworkspacedata ├── TestRefresh1 ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── LeftTableViewController.h ├── LeftTableViewController.m ├── RightTableViewController.h ├── RightTableViewController.m ├── ViewController.h ├── ViewController.m └── main.m ├── TestRefresh1Tests ├── Info.plist └── TestRefresh1Tests.m └── TestRefresh1UITests ├── Info.plist └── TestRefresh1UITests.m /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/objective-c,macos 3 | 4 | ### macOS ### 5 | *.DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | 9 | # Icon must end with two \r 10 | Icon 11 | 12 | 13 | # Thumbnails 14 | ._* 15 | 16 | # Files that might appear in the root of a volume 17 | .DocumentRevisions-V100 18 | .fseventsd 19 | .Spotlight-V100 20 | .TemporaryItems 21 | .Trashes 22 | .VolumeIcon.icns 23 | .com.apple.timemachine.donotpresent 24 | 25 | # Directories potentially created on remote AFP share 26 | .AppleDB 27 | .AppleDesktop 28 | Network Trash Folder 29 | Temporary Items 30 | .apdisk 31 | 32 | ### Objective-C ### 33 | # Xcode 34 | # 35 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 36 | 37 | ## Build generated 38 | build/ 39 | DerivedData/ 40 | 41 | ## Various settings 42 | *.pbxuser 43 | !default.pbxuser 44 | *.mode1v3 45 | !default.mode1v3 46 | *.mode2v3 47 | !default.mode2v3 48 | *.perspectivev3 49 | !default.perspectivev3 50 | xcuserdata/ 51 | 52 | ## Other 53 | *.moved-aside 54 | *.xccheckout 55 | *.xcscmblueprint 56 | 57 | ## Obj-C/Swift specific 58 | *.hmap 59 | *.ipa 60 | *.dSYM.zip 61 | *.dSYM 62 | 63 | # CocoaPods 64 | # 65 | # We recommend against adding the Pods directory to your .gitignore. However 66 | # you should judge for yourself, the pros and cons are mentioned at: 67 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 68 | # 69 | # Pods/ 70 | 71 | # Carthage 72 | # 73 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 74 | # Carthage/Checkouts 75 | 76 | Carthage/Build 77 | 78 | # fastlane 79 | # 80 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 81 | # screenshots whenever they are needed. 82 | # For more information about the recommended setup visit: 83 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 84 | 85 | fastlane/report.xml 86 | fastlane/Preview.html 87 | fastlane/screenshots 88 | fastlane/test_output 89 | 90 | # Code Injection 91 | # 92 | # After new code Injection tools there's a generated folder /iOSInjectionProject 93 | # https://github.com/johnno1962/injectionforxcode 94 | 95 | iOSInjectionProject/ 96 | 97 | ### Objective-C Patch ### 98 | 99 | # End of https://www.gitignore.io/api/objective-c,macos 100 | /Load+Initialize/.DS_Store 101 | /Load+Initialize/Load+Initialize.xcodeproj/project.xcworkspace/xcuserdata/mjpc.xcuserdatad/UserInterfaceState.xcuserstate 102 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1062E1C11E7999FB00983250 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1062E1C01E7999FB00983250 /* main.m */; }; 11 | 1062E1C41E7999FB00983250 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1062E1C31E7999FB00983250 /* AppDelegate.m */; }; 12 | 1062E1C71E7999FB00983250 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1062E1C61E7999FB00983250 /* ViewController.m */; }; 13 | 1062E1CA1E7999FB00983250 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1062E1C81E7999FB00983250 /* Main.storyboard */; }; 14 | 1062E1CC1E7999FB00983250 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1062E1CB1E7999FB00983250 /* Assets.xcassets */; }; 15 | 1062E1CF1E7999FB00983250 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1062E1CD1E7999FB00983250 /* LaunchScreen.storyboard */; }; 16 | 1062E1DA1E7999FB00983250 /* Copy_Strong_Array_MutableArrayTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1062E1D91E7999FB00983250 /* Copy_Strong_Array_MutableArrayTests.m */; }; 17 | 1062E1E51E7999FB00983250 /* Copy_Strong_Array_MutableArrayUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1062E1E41E7999FB00983250 /* Copy_Strong_Array_MutableArrayUITests.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 1062E1D61E7999FB00983250 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 1062E1B41E7999FB00983250 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 1062E1BB1E7999FB00983250; 26 | remoteInfo = "Copy-Strong-Array-MutableArray"; 27 | }; 28 | 1062E1E11E7999FB00983250 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 1062E1B41E7999FB00983250 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 1062E1BB1E7999FB00983250; 33 | remoteInfo = "Copy-Strong-Array-MutableArray"; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 1062E1BC1E7999FB00983250 /* Copy-Strong-Array-MutableArray.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Copy-Strong-Array-MutableArray.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 1062E1C01E7999FB00983250 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | 1062E1C21E7999FB00983250 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | 1062E1C31E7999FB00983250 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | 1062E1C51E7999FB00983250 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 43 | 1062E1C61E7999FB00983250 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 44 | 1062E1C91E7999FB00983250 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 1062E1CB1E7999FB00983250 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 1062E1CE1E7999FB00983250 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 1062E1D01E7999FB00983250 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 1062E1D51E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Copy-Strong-Array-MutableArrayTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 1062E1D91E7999FB00983250 /* Copy_Strong_Array_MutableArrayTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Copy_Strong_Array_MutableArrayTests.m; sourceTree = ""; }; 50 | 1062E1DB1E7999FB00983250 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 1062E1E01E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Copy-Strong-Array-MutableArrayUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 1062E1E41E7999FB00983250 /* Copy_Strong_Array_MutableArrayUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Copy_Strong_Array_MutableArrayUITests.m; sourceTree = ""; }; 53 | 1062E1E61E7999FB00983250 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 1062E1B91E7999FB00983250 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | 1062E1D21E7999FB00983250 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 1062E1DD1E7999FB00983250 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 1062E1B31E7999FB00983250 = { 82 | isa = PBXGroup; 83 | children = ( 84 | 1062E1BE1E7999FB00983250 /* Copy-Strong-Array-MutableArray */, 85 | 1062E1D81E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests */, 86 | 1062E1E31E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests */, 87 | 1062E1BD1E7999FB00983250 /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 1062E1BD1E7999FB00983250 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 1062E1BC1E7999FB00983250 /* Copy-Strong-Array-MutableArray.app */, 95 | 1062E1D51E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests.xctest */, 96 | 1062E1E01E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 1062E1BE1E7999FB00983250 /* Copy-Strong-Array-MutableArray */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 1062E1C21E7999FB00983250 /* AppDelegate.h */, 105 | 1062E1C31E7999FB00983250 /* AppDelegate.m */, 106 | 1062E1C51E7999FB00983250 /* ViewController.h */, 107 | 1062E1C61E7999FB00983250 /* ViewController.m */, 108 | 1062E1C81E7999FB00983250 /* Main.storyboard */, 109 | 1062E1CB1E7999FB00983250 /* Assets.xcassets */, 110 | 1062E1CD1E7999FB00983250 /* LaunchScreen.storyboard */, 111 | 1062E1D01E7999FB00983250 /* Info.plist */, 112 | 1062E1BF1E7999FB00983250 /* Supporting Files */, 113 | ); 114 | path = "Copy-Strong-Array-MutableArray"; 115 | sourceTree = ""; 116 | }; 117 | 1062E1BF1E7999FB00983250 /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 1062E1C01E7999FB00983250 /* main.m */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | 1062E1D81E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 1062E1D91E7999FB00983250 /* Copy_Strong_Array_MutableArrayTests.m */, 129 | 1062E1DB1E7999FB00983250 /* Info.plist */, 130 | ); 131 | path = "Copy-Strong-Array-MutableArrayTests"; 132 | sourceTree = ""; 133 | }; 134 | 1062E1E31E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 1062E1E41E7999FB00983250 /* Copy_Strong_Array_MutableArrayUITests.m */, 138 | 1062E1E61E7999FB00983250 /* Info.plist */, 139 | ); 140 | path = "Copy-Strong-Array-MutableArrayUITests"; 141 | sourceTree = ""; 142 | }; 143 | /* End PBXGroup section */ 144 | 145 | /* Begin PBXNativeTarget section */ 146 | 1062E1BB1E7999FB00983250 /* Copy-Strong-Array-MutableArray */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = 1062E1E91E7999FB00983250 /* Build configuration list for PBXNativeTarget "Copy-Strong-Array-MutableArray" */; 149 | buildPhases = ( 150 | 1062E1B81E7999FB00983250 /* Sources */, 151 | 1062E1B91E7999FB00983250 /* Frameworks */, 152 | 1062E1BA1E7999FB00983250 /* Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = "Copy-Strong-Array-MutableArray"; 159 | productName = "Copy-Strong-Array-MutableArray"; 160 | productReference = 1062E1BC1E7999FB00983250 /* Copy-Strong-Array-MutableArray.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | 1062E1D41E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = 1062E1EC1E7999FB00983250 /* Build configuration list for PBXNativeTarget "Copy-Strong-Array-MutableArrayTests" */; 166 | buildPhases = ( 167 | 1062E1D11E7999FB00983250 /* Sources */, 168 | 1062E1D21E7999FB00983250 /* Frameworks */, 169 | 1062E1D31E7999FB00983250 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | 1062E1D71E7999FB00983250 /* PBXTargetDependency */, 175 | ); 176 | name = "Copy-Strong-Array-MutableArrayTests"; 177 | productName = "Copy-Strong-Array-MutableArrayTests"; 178 | productReference = 1062E1D51E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests.xctest */; 179 | productType = "com.apple.product-type.bundle.unit-test"; 180 | }; 181 | 1062E1DF1E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = 1062E1EF1E7999FB00983250 /* Build configuration list for PBXNativeTarget "Copy-Strong-Array-MutableArrayUITests" */; 184 | buildPhases = ( 185 | 1062E1DC1E7999FB00983250 /* Sources */, 186 | 1062E1DD1E7999FB00983250 /* Frameworks */, 187 | 1062E1DE1E7999FB00983250 /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | 1062E1E21E7999FB00983250 /* PBXTargetDependency */, 193 | ); 194 | name = "Copy-Strong-Array-MutableArrayUITests"; 195 | productName = "Copy-Strong-Array-MutableArrayUITests"; 196 | productReference = 1062E1E01E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests.xctest */; 197 | productType = "com.apple.product-type.bundle.ui-testing"; 198 | }; 199 | /* End PBXNativeTarget section */ 200 | 201 | /* Begin PBXProject section */ 202 | 1062E1B41E7999FB00983250 /* Project object */ = { 203 | isa = PBXProject; 204 | attributes = { 205 | LastUpgradeCheck = 0820; 206 | ORGANIZATIONNAME = mali; 207 | TargetAttributes = { 208 | 1062E1BB1E7999FB00983250 = { 209 | CreatedOnToolsVersion = 8.2.1; 210 | ProvisioningStyle = Automatic; 211 | }; 212 | 1062E1D41E7999FB00983250 = { 213 | CreatedOnToolsVersion = 8.2.1; 214 | ProvisioningStyle = Automatic; 215 | TestTargetID = 1062E1BB1E7999FB00983250; 216 | }; 217 | 1062E1DF1E7999FB00983250 = { 218 | CreatedOnToolsVersion = 8.2.1; 219 | ProvisioningStyle = Automatic; 220 | TestTargetID = 1062E1BB1E7999FB00983250; 221 | }; 222 | }; 223 | }; 224 | buildConfigurationList = 1062E1B71E7999FB00983250 /* Build configuration list for PBXProject "Copy-Strong-Array-MutableArray" */; 225 | compatibilityVersion = "Xcode 3.2"; 226 | developmentRegion = English; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | en, 230 | Base, 231 | ); 232 | mainGroup = 1062E1B31E7999FB00983250; 233 | productRefGroup = 1062E1BD1E7999FB00983250 /* Products */; 234 | projectDirPath = ""; 235 | projectRoot = ""; 236 | targets = ( 237 | 1062E1BB1E7999FB00983250 /* Copy-Strong-Array-MutableArray */, 238 | 1062E1D41E7999FB00983250 /* Copy-Strong-Array-MutableArrayTests */, 239 | 1062E1DF1E7999FB00983250 /* Copy-Strong-Array-MutableArrayUITests */, 240 | ); 241 | }; 242 | /* End PBXProject section */ 243 | 244 | /* Begin PBXResourcesBuildPhase section */ 245 | 1062E1BA1E7999FB00983250 /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 1062E1CF1E7999FB00983250 /* LaunchScreen.storyboard in Resources */, 250 | 1062E1CC1E7999FB00983250 /* Assets.xcassets in Resources */, 251 | 1062E1CA1E7999FB00983250 /* Main.storyboard in Resources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | 1062E1D31E7999FB00983250 /* Resources */ = { 256 | isa = PBXResourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | 1062E1DE1E7999FB00983250 /* Resources */ = { 263 | isa = PBXResourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | /* End PBXResourcesBuildPhase section */ 270 | 271 | /* Begin PBXSourcesBuildPhase section */ 272 | 1062E1B81E7999FB00983250 /* Sources */ = { 273 | isa = PBXSourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | 1062E1C71E7999FB00983250 /* ViewController.m in Sources */, 277 | 1062E1C41E7999FB00983250 /* AppDelegate.m in Sources */, 278 | 1062E1C11E7999FB00983250 /* main.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | 1062E1D11E7999FB00983250 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 1062E1DA1E7999FB00983250 /* Copy_Strong_Array_MutableArrayTests.m in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | 1062E1DC1E7999FB00983250 /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | 1062E1E51E7999FB00983250 /* Copy_Strong_Array_MutableArrayUITests.m in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXTargetDependency section */ 301 | 1062E1D71E7999FB00983250 /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = 1062E1BB1E7999FB00983250 /* Copy-Strong-Array-MutableArray */; 304 | targetProxy = 1062E1D61E7999FB00983250 /* PBXContainerItemProxy */; 305 | }; 306 | 1062E1E21E7999FB00983250 /* PBXTargetDependency */ = { 307 | isa = PBXTargetDependency; 308 | target = 1062E1BB1E7999FB00983250 /* Copy-Strong-Array-MutableArray */; 309 | targetProxy = 1062E1E11E7999FB00983250 /* PBXContainerItemProxy */; 310 | }; 311 | /* End PBXTargetDependency section */ 312 | 313 | /* Begin PBXVariantGroup section */ 314 | 1062E1C81E7999FB00983250 /* Main.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 1062E1C91E7999FB00983250 /* Base */, 318 | ); 319 | name = Main.storyboard; 320 | sourceTree = ""; 321 | }; 322 | 1062E1CD1E7999FB00983250 /* LaunchScreen.storyboard */ = { 323 | isa = PBXVariantGroup; 324 | children = ( 325 | 1062E1CE1E7999FB00983250 /* Base */, 326 | ); 327 | name = LaunchScreen.storyboard; 328 | sourceTree = ""; 329 | }; 330 | /* End PBXVariantGroup section */ 331 | 332 | /* Begin XCBuildConfiguration section */ 333 | 1062E1E71E7999FB00983250 /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = dwarf; 357 | ENABLE_STRICT_OBJC_MSGSEND = YES; 358 | ENABLE_TESTABILITY = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_DYNAMIC_NO_PIC = NO; 361 | GCC_NO_COMMON_BLOCKS = YES; 362 | GCC_OPTIMIZATION_LEVEL = 0; 363 | GCC_PREPROCESSOR_DEFINITIONS = ( 364 | "DEBUG=1", 365 | "$(inherited)", 366 | ); 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 374 | MTL_ENABLE_DEBUG_INFO = YES; 375 | ONLY_ACTIVE_ARCH = YES; 376 | SDKROOT = iphoneos; 377 | }; 378 | name = Debug; 379 | }; 380 | 1062E1E81E7999FB00983250 /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_ANALYZER_NONNULL = YES; 385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 386 | CLANG_CXX_LIBRARY = "libc++"; 387 | CLANG_ENABLE_MODULES = YES; 388 | CLANG_ENABLE_OBJC_ARC = YES; 389 | CLANG_WARN_BOOL_CONVERSION = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 393 | CLANG_WARN_EMPTY_BODY = YES; 394 | CLANG_WARN_ENUM_CONVERSION = YES; 395 | CLANG_WARN_INFINITE_RECURSION = YES; 396 | CLANG_WARN_INT_CONVERSION = YES; 397 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 398 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 399 | CLANG_WARN_UNREACHABLE_CODE = YES; 400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 402 | COPY_PHASE_STRIP = NO; 403 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 404 | ENABLE_NS_ASSERTIONS = NO; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | GCC_C_LANGUAGE_STANDARD = gnu99; 407 | GCC_NO_COMMON_BLOCKS = YES; 408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 410 | GCC_WARN_UNDECLARED_SELECTOR = YES; 411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 412 | GCC_WARN_UNUSED_FUNCTION = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 415 | MTL_ENABLE_DEBUG_INFO = NO; 416 | SDKROOT = iphoneos; 417 | VALIDATE_PRODUCT = YES; 418 | }; 419 | name = Release; 420 | }; 421 | 1062E1EA1E7999FB00983250 /* Debug */ = { 422 | isa = XCBuildConfiguration; 423 | buildSettings = { 424 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 425 | INFOPLIST_FILE = "Copy-Strong-Array-MutableArray/Info.plist"; 426 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 427 | PRODUCT_BUNDLE_IDENTIFIER = "com.SuperMario.Copy-Strong-Array-MutableArray"; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | }; 430 | name = Debug; 431 | }; 432 | 1062E1EB1E7999FB00983250 /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 436 | INFOPLIST_FILE = "Copy-Strong-Array-MutableArray/Info.plist"; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 438 | PRODUCT_BUNDLE_IDENTIFIER = "com.SuperMario.Copy-Strong-Array-MutableArray"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | }; 441 | name = Release; 442 | }; 443 | 1062E1ED1E7999FB00983250 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | BUNDLE_LOADER = "$(TEST_HOST)"; 447 | INFOPLIST_FILE = "Copy-Strong-Array-MutableArrayTests/Info.plist"; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = "com.SuperMario.Copy-Strong-Array-MutableArrayTests"; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Copy-Strong-Array-MutableArray.app/Copy-Strong-Array-MutableArray"; 452 | }; 453 | name = Debug; 454 | }; 455 | 1062E1EE1E7999FB00983250 /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | BUNDLE_LOADER = "$(TEST_HOST)"; 459 | INFOPLIST_FILE = "Copy-Strong-Array-MutableArrayTests/Info.plist"; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 461 | PRODUCT_BUNDLE_IDENTIFIER = "com.SuperMario.Copy-Strong-Array-MutableArrayTests"; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Copy-Strong-Array-MutableArray.app/Copy-Strong-Array-MutableArray"; 464 | }; 465 | name = Release; 466 | }; 467 | 1062E1F01E7999FB00983250 /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | INFOPLIST_FILE = "Copy-Strong-Array-MutableArrayUITests/Info.plist"; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 472 | PRODUCT_BUNDLE_IDENTIFIER = "com.SuperMario.Copy-Strong-Array-MutableArrayUITests"; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | TEST_TARGET_NAME = "Copy-Strong-Array-MutableArray"; 475 | }; 476 | name = Debug; 477 | }; 478 | 1062E1F11E7999FB00983250 /* Release */ = { 479 | isa = XCBuildConfiguration; 480 | buildSettings = { 481 | INFOPLIST_FILE = "Copy-Strong-Array-MutableArrayUITests/Info.plist"; 482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 483 | PRODUCT_BUNDLE_IDENTIFIER = "com.SuperMario.Copy-Strong-Array-MutableArrayUITests"; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | TEST_TARGET_NAME = "Copy-Strong-Array-MutableArray"; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | 1062E1B71E7999FB00983250 /* Build configuration list for PBXProject "Copy-Strong-Array-MutableArray" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 1062E1E71E7999FB00983250 /* Debug */, 496 | 1062E1E81E7999FB00983250 /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | 1062E1E91E7999FB00983250 /* Build configuration list for PBXNativeTarget "Copy-Strong-Array-MutableArray" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | 1062E1EA1E7999FB00983250 /* Debug */, 505 | 1062E1EB1E7999FB00983250 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | }; 509 | 1062E1EC1E7999FB00983250 /* Build configuration list for PBXNativeTarget "Copy-Strong-Array-MutableArrayTests" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 1062E1ED1E7999FB00983250 /* Debug */, 513 | 1062E1EE1E7999FB00983250 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | }; 517 | 1062E1EF1E7999FB00983250 /* Build configuration list for PBXNativeTarget "Copy-Strong-Array-MutableArrayUITests" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | 1062E1F01E7999FB00983250 /* Debug */, 521 | 1062E1F11E7999FB00983250 /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | }; 525 | /* End XCConfigurationList section */ 526 | }; 527 | rootObject = 1062E1B41E7999FB00983250 /* Project object */; 528 | } 529 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Copy-Strong-Array-MutableArray 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Copy-Strong-Array-MutableArray 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/Assets.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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Copy-Strong-Array-MutableArray 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Copy-Strong-Array-MutableArray 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @property (nonatomic, strong) NSArray *arrayOfStrong; 14 | @property (nonatomic, copy) NSArray *arrayOfCopy; 15 | @property (nonatomic, copy) NSArray *arrayOfCopy2; 16 | @property (nonatomic, strong) NSMutableArray *mutableArrayOfStrong; 17 | @property (nonatomic, copy) NSMutableArray *mutableArrayOfCopy; 18 | 19 | @end 20 | 21 | @implementation ViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithArray:@[@"A"]]; 26 | NSLog(@"mutableArray地址为 %p", mutableArray); 27 | self.arrayOfStrong = mutableArray; 28 | self.arrayOfCopy = mutableArray; 29 | _arrayOfCopy2 = mutableArray; 30 | 31 | [mutableArray addObject:@"B"]; 32 | NSLog(@"arrayOfStrong:%@ 地址为%p",_arrayOfStrong, _arrayOfStrong); 33 | NSLog(@"arrayOfCopy:%@ 地址为%p",_arrayOfCopy, _arrayOfCopy); 34 | NSLog(@"arrayOfCopy2:%@ 地址为%p", _arrayOfCopy2, _arrayOfCopy2); 35 | 36 | 37 | NSLog(@"------------------------------------------------------"); 38 | 39 | self.mutableArrayOfStrong = mutableArray; 40 | [_mutableArrayOfStrong addObject:@"C"]; 41 | 42 | self.mutableArrayOfCopy = mutableArray; 43 | 44 | NSLog(@"mutableArrayOfStrong:%@ 地址为%p",_mutableArrayOfStrong, _mutableArrayOfStrong); 45 | NSLog(@"mutableArrayOfCopy's class is %@", [_mutableArrayOfCopy class]); 46 | } 47 | 48 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 49 | //crash 50 | [_mutableArrayOfCopy addObject:@"C"]; 51 | } 52 | 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArray/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Copy-Strong-Array-MutableArray 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArrayTests/Copy_Strong_Array_MutableArrayTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copy_Strong_Array_MutableArrayTests.m 3 | // Copy-Strong-Array-MutableArrayTests 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Copy_Strong_Array_MutableArrayTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Copy_Strong_Array_MutableArrayTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArrayTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArrayUITests/Copy_Strong_Array_MutableArrayUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copy_Strong_Array_MutableArrayUITests.m 3 | // Copy-Strong-Array-MutableArrayUITests 4 | // 5 | // Created by mali on 2017/3/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Copy_Strong_Array_MutableArrayUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Copy_Strong_Array_MutableArrayUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/Copy-Strong-Array-MutableArrayUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Copy-Strong-Array-MutableArray/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 MaLi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize.xcodeproj/xcuserdata/mjpc.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize.xcodeproj/xcuserdata/mjpc.xcuserdatad/xcschemes/Load+Initialize.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize.xcodeproj/xcuserdata/mjpc.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Load+Initialize.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 100C07891E616302007E3745 16 | 17 | primary 18 | 19 | 20 | 100C07A21E616302007E3745 21 | 22 | primary 23 | 24 | 25 | 100C07AD1E616302007E3745 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Assets.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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Father.h: -------------------------------------------------------------------------------- 1 | // 2 | // Father.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Father : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Father.m: -------------------------------------------------------------------------------- 1 | // 2 | // Father.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Father.h" 10 | 11 | @implementation Father 12 | 13 | + (void)load { 14 | NSLog(@"Father:%s %@", __FUNCTION__, [self class]); 15 | } 16 | 17 | + (void)initialize { 18 | NSLog(@"Father:%s %@", __FUNCTION__, [self class]); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Other+initialize.h: -------------------------------------------------------------------------------- 1 | // 2 | // Other+initialize.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/26. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Other.h" 11 | 12 | @interface Other(initialize) 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Other+initialize.m: -------------------------------------------------------------------------------- 1 | // 2 | // Other+initialize.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/26. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Other+initialize.h" 10 | 11 | @implementation Other(initialize) 12 | 13 | + (void)initialize { 14 | NSLog(@"Other+initialize:%s %@", __FUNCTION__, [self class]); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Other.h: -------------------------------------------------------------------------------- 1 | // 2 | // Ohter.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Other : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Other.m: -------------------------------------------------------------------------------- 1 | // 2 | // Ohter.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Other.h" 10 | 11 | @implementation Other 12 | 13 | + (void)load { 14 | NSLog(@"Other:%s %@", __FUNCTION__, [self class]); 15 | } 16 | 17 | + (void)initialize { 18 | NSLog(@"Other:%s %@", __FUNCTION__, [self class]); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Son+load.h: -------------------------------------------------------------------------------- 1 | // 2 | // Son+load.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Son.h" 11 | 12 | @interface Son (load) 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Son+load.m: -------------------------------------------------------------------------------- 1 | // 2 | // Son+load.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Son+load.h" 10 | 11 | @implementation Son (load) 12 | 13 | + (void)load { 14 | NSLog(@"Son+load:%s %@", __FUNCTION__, [self class]); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Son.h: -------------------------------------------------------------------------------- 1 | // 2 | // Son.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Father.h" 10 | 11 | @interface Son : Father 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/Son.m: -------------------------------------------------------------------------------- 1 | // 2 | // Son.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Son.h" 10 | 11 | @implementation Son 12 | 13 | + (void)load { 14 | NSLog(@"Son:%s %@", __FUNCTION__, [self class]); 15 | } 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Load+Initialize/Load+Initialize/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Load+Initialize 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | NSLog(@"Main method start!"); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /Load+Initialize/Load+InitializeTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Load+Initialize/Load+InitializeTests/Load_InitializeTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Load_InitializeTests.m 3 | // Load+InitializeTests 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Load_InitializeTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Load_InitializeTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Load+Initialize/Load+InitializeUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Load+Initialize/Load+InitializeUITests/Load_InitializeUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Load_InitializeUITests.m 3 | // Load+InitializeUITests 4 | // 5 | // Created by mjpc on 2017/2/25. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Load_InitializeUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Load_InitializeUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maligh/ML-Objective-C-Demo/97fc43dba0c93d8cf212e97131740017d077f78d/LockPerformance/LockPerformance.jpg -------------------------------------------------------------------------------- /LockPerformance/LockPerformance.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2466DE692041153B0002C569 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2466DE682041153B0002C569 /* AppDelegate.m */; }; 11 | 2466DE6C2041153B0002C569 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2466DE6B2041153B0002C569 /* ViewController.m */; }; 12 | 2466DE6F2041153B0002C569 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2466DE6D2041153B0002C569 /* Main.storyboard */; }; 13 | 2466DE712041153B0002C569 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2466DE702041153B0002C569 /* Assets.xcassets */; }; 14 | 2466DE742041153B0002C569 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2466DE722041153B0002C569 /* LaunchScreen.storyboard */; }; 15 | 2466DE772041153B0002C569 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2466DE762041153B0002C569 /* main.m */; }; 16 | 2466DE812041153B0002C569 /* LockPerformanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2466DE802041153B0002C569 /* LockPerformanceTests.m */; }; 17 | 2466DE8C2041153C0002C569 /* LockPerformanceUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2466DE8B2041153B0002C569 /* LockPerformanceUITests.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 2466DE7D2041153B0002C569 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 2466DE5C2041153B0002C569 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 2466DE632041153B0002C569; 26 | remoteInfo = LockPerformance; 27 | }; 28 | 2466DE882041153B0002C569 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 2466DE5C2041153B0002C569 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 2466DE632041153B0002C569; 33 | remoteInfo = LockPerformance; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 2466DE642041153B0002C569 /* LockPerformance.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LockPerformance.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 2466DE672041153B0002C569 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | 2466DE682041153B0002C569 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | 2466DE6A2041153B0002C569 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 42 | 2466DE6B2041153B0002C569 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 43 | 2466DE6E2041153B0002C569 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 2466DE702041153B0002C569 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 2466DE732041153B0002C569 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 2466DE752041153B0002C569 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 2466DE762041153B0002C569 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | 2466DE7C2041153B0002C569 /* LockPerformanceTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LockPerformanceTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 2466DE802041153B0002C569 /* LockPerformanceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LockPerformanceTests.m; sourceTree = ""; }; 50 | 2466DE822041153B0002C569 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 2466DE872041153B0002C569 /* LockPerformanceUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LockPerformanceUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 2466DE8B2041153B0002C569 /* LockPerformanceUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LockPerformanceUITests.m; sourceTree = ""; }; 53 | 2466DE8D2041153C0002C569 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 2466DE612041153B0002C569 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | 2466DE792041153B0002C569 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 2466DE842041153B0002C569 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 2466DE5B2041153B0002C569 = { 82 | isa = PBXGroup; 83 | children = ( 84 | 2466DE662041153B0002C569 /* LockPerformance */, 85 | 2466DE7F2041153B0002C569 /* LockPerformanceTests */, 86 | 2466DE8A2041153B0002C569 /* LockPerformanceUITests */, 87 | 2466DE652041153B0002C569 /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 2466DE652041153B0002C569 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 2466DE642041153B0002C569 /* LockPerformance.app */, 95 | 2466DE7C2041153B0002C569 /* LockPerformanceTests.xctest */, 96 | 2466DE872041153B0002C569 /* LockPerformanceUITests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 2466DE662041153B0002C569 /* LockPerformance */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 2466DE672041153B0002C569 /* AppDelegate.h */, 105 | 2466DE682041153B0002C569 /* AppDelegate.m */, 106 | 2466DE6A2041153B0002C569 /* ViewController.h */, 107 | 2466DE6B2041153B0002C569 /* ViewController.m */, 108 | 2466DE6D2041153B0002C569 /* Main.storyboard */, 109 | 2466DE702041153B0002C569 /* Assets.xcassets */, 110 | 2466DE722041153B0002C569 /* LaunchScreen.storyboard */, 111 | 2466DE752041153B0002C569 /* Info.plist */, 112 | 2466DE762041153B0002C569 /* main.m */, 113 | ); 114 | path = LockPerformance; 115 | sourceTree = ""; 116 | }; 117 | 2466DE7F2041153B0002C569 /* LockPerformanceTests */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 2466DE802041153B0002C569 /* LockPerformanceTests.m */, 121 | 2466DE822041153B0002C569 /* Info.plist */, 122 | ); 123 | path = LockPerformanceTests; 124 | sourceTree = ""; 125 | }; 126 | 2466DE8A2041153B0002C569 /* LockPerformanceUITests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 2466DE8B2041153B0002C569 /* LockPerformanceUITests.m */, 130 | 2466DE8D2041153C0002C569 /* Info.plist */, 131 | ); 132 | path = LockPerformanceUITests; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | 2466DE632041153B0002C569 /* LockPerformance */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 2466DE902041153C0002C569 /* Build configuration list for PBXNativeTarget "LockPerformance" */; 141 | buildPhases = ( 142 | 2466DE602041153B0002C569 /* Sources */, 143 | 2466DE612041153B0002C569 /* Frameworks */, 144 | 2466DE622041153B0002C569 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = LockPerformance; 151 | productName = LockPerformance; 152 | productReference = 2466DE642041153B0002C569 /* LockPerformance.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | 2466DE7B2041153B0002C569 /* LockPerformanceTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = 2466DE932041153C0002C569 /* Build configuration list for PBXNativeTarget "LockPerformanceTests" */; 158 | buildPhases = ( 159 | 2466DE782041153B0002C569 /* Sources */, 160 | 2466DE792041153B0002C569 /* Frameworks */, 161 | 2466DE7A2041153B0002C569 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | 2466DE7E2041153B0002C569 /* PBXTargetDependency */, 167 | ); 168 | name = LockPerformanceTests; 169 | productName = LockPerformanceTests; 170 | productReference = 2466DE7C2041153B0002C569 /* LockPerformanceTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | 2466DE862041153B0002C569 /* LockPerformanceUITests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 2466DE962041153C0002C569 /* Build configuration list for PBXNativeTarget "LockPerformanceUITests" */; 176 | buildPhases = ( 177 | 2466DE832041153B0002C569 /* Sources */, 178 | 2466DE842041153B0002C569 /* Frameworks */, 179 | 2466DE852041153B0002C569 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | 2466DE892041153B0002C569 /* PBXTargetDependency */, 185 | ); 186 | name = LockPerformanceUITests; 187 | productName = LockPerformanceUITests; 188 | productReference = 2466DE872041153B0002C569 /* LockPerformanceUITests.xctest */; 189 | productType = "com.apple.product-type.bundle.ui-testing"; 190 | }; 191 | /* End PBXNativeTarget section */ 192 | 193 | /* Begin PBXProject section */ 194 | 2466DE5C2041153B0002C569 /* Project object */ = { 195 | isa = PBXProject; 196 | attributes = { 197 | LastUpgradeCheck = 0920; 198 | ORGANIZATIONNAME = mali; 199 | TargetAttributes = { 200 | 2466DE632041153B0002C569 = { 201 | CreatedOnToolsVersion = 9.2; 202 | ProvisioningStyle = Automatic; 203 | }; 204 | 2466DE7B2041153B0002C569 = { 205 | CreatedOnToolsVersion = 9.2; 206 | ProvisioningStyle = Automatic; 207 | TestTargetID = 2466DE632041153B0002C569; 208 | }; 209 | 2466DE862041153B0002C569 = { 210 | CreatedOnToolsVersion = 9.2; 211 | ProvisioningStyle = Automatic; 212 | TestTargetID = 2466DE632041153B0002C569; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 2466DE5F2041153B0002C569 /* Build configuration list for PBXProject "LockPerformance" */; 217 | compatibilityVersion = "Xcode 8.0"; 218 | developmentRegion = en; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = 2466DE5B2041153B0002C569; 225 | productRefGroup = 2466DE652041153B0002C569 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | 2466DE632041153B0002C569 /* LockPerformance */, 230 | 2466DE7B2041153B0002C569 /* LockPerformanceTests */, 231 | 2466DE862041153B0002C569 /* LockPerformanceUITests */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | 2466DE622041153B0002C569 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | 2466DE742041153B0002C569 /* LaunchScreen.storyboard in Resources */, 242 | 2466DE712041153B0002C569 /* Assets.xcassets in Resources */, 243 | 2466DE6F2041153B0002C569 /* Main.storyboard in Resources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | 2466DE7A2041153B0002C569 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | 2466DE852041153B0002C569 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | 2466DE602041153B0002C569 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 2466DE6C2041153B0002C569 /* ViewController.m in Sources */, 269 | 2466DE772041153B0002C569 /* main.m in Sources */, 270 | 2466DE692041153B0002C569 /* AppDelegate.m in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | 2466DE782041153B0002C569 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 2466DE812041153B0002C569 /* LockPerformanceTests.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | 2466DE832041153B0002C569 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 2466DE8C2041153C0002C569 /* LockPerformanceUITests.m in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | /* End PBXSourcesBuildPhase section */ 291 | 292 | /* Begin PBXTargetDependency section */ 293 | 2466DE7E2041153B0002C569 /* PBXTargetDependency */ = { 294 | isa = PBXTargetDependency; 295 | target = 2466DE632041153B0002C569 /* LockPerformance */; 296 | targetProxy = 2466DE7D2041153B0002C569 /* PBXContainerItemProxy */; 297 | }; 298 | 2466DE892041153B0002C569 /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = 2466DE632041153B0002C569 /* LockPerformance */; 301 | targetProxy = 2466DE882041153B0002C569 /* PBXContainerItemProxy */; 302 | }; 303 | /* End PBXTargetDependency section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | 2466DE6D2041153B0002C569 /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 2466DE6E2041153B0002C569 /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | 2466DE722041153B0002C569 /* LaunchScreen.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 2466DE732041153B0002C569 /* Base */, 318 | ); 319 | name = LaunchScreen.storyboard; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | 2466DE8E2041153C0002C569 /* Debug */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_ANALYZER_NONNULL = YES; 330 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 336 | CLANG_WARN_BOOL_CONVERSION = YES; 337 | CLANG_WARN_COMMA = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 340 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INFINITE_RECURSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 347 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 348 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 349 | CLANG_WARN_STRICT_PROTOTYPES = YES; 350 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 351 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | CODE_SIGN_IDENTITY = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = dwarf; 357 | ENABLE_STRICT_OBJC_MSGSEND = YES; 358 | ENABLE_TESTABILITY = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu11; 360 | GCC_DYNAMIC_NO_PIC = NO; 361 | GCC_NO_COMMON_BLOCKS = YES; 362 | GCC_OPTIMIZATION_LEVEL = 0; 363 | GCC_PREPROCESSOR_DEFINITIONS = ( 364 | "DEBUG=1", 365 | "$(inherited)", 366 | ); 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 374 | MTL_ENABLE_DEBUG_INFO = YES; 375 | ONLY_ACTIVE_ARCH = YES; 376 | SDKROOT = iphoneos; 377 | }; 378 | name = Debug; 379 | }; 380 | 2466DE8F2041153C0002C569 /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_ANALYZER_NONNULL = YES; 385 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 386 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 387 | CLANG_CXX_LIBRARY = "libc++"; 388 | CLANG_ENABLE_MODULES = YES; 389 | CLANG_ENABLE_OBJC_ARC = YES; 390 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_COMMA = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 395 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 396 | CLANG_WARN_EMPTY_BODY = YES; 397 | CLANG_WARN_ENUM_CONVERSION = YES; 398 | CLANG_WARN_INFINITE_RECURSION = YES; 399 | CLANG_WARN_INT_CONVERSION = YES; 400 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 401 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 404 | CLANG_WARN_STRICT_PROTOTYPES = YES; 405 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 406 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 407 | CLANG_WARN_UNREACHABLE_CODE = YES; 408 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 409 | CODE_SIGN_IDENTITY = "iPhone Developer"; 410 | COPY_PHASE_STRIP = NO; 411 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 412 | ENABLE_NS_ASSERTIONS = NO; 413 | ENABLE_STRICT_OBJC_MSGSEND = YES; 414 | GCC_C_LANGUAGE_STANDARD = gnu11; 415 | GCC_NO_COMMON_BLOCKS = YES; 416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 418 | GCC_WARN_UNDECLARED_SELECTOR = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | GCC_WARN_UNUSED_VARIABLE = YES; 422 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 423 | MTL_ENABLE_DEBUG_INFO = NO; 424 | SDKROOT = iphoneos; 425 | VALIDATE_PRODUCT = YES; 426 | }; 427 | name = Release; 428 | }; 429 | 2466DE912041153C0002C569 /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 433 | CODE_SIGN_STYLE = Automatic; 434 | INFOPLIST_FILE = LockPerformance/Info.plist; 435 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 436 | PRODUCT_BUNDLE_IDENTIFIER = com.mali.LockPerformance; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | }; 440 | name = Debug; 441 | }; 442 | 2466DE922041153C0002C569 /* Release */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 446 | CODE_SIGN_STYLE = Automatic; 447 | INFOPLIST_FILE = LockPerformance/Info.plist; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = com.mali.LockPerformance; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | TARGETED_DEVICE_FAMILY = "1,2"; 452 | }; 453 | name = Release; 454 | }; 455 | 2466DE942041153C0002C569 /* Debug */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | BUNDLE_LOADER = "$(TEST_HOST)"; 459 | CODE_SIGN_STYLE = Automatic; 460 | INFOPLIST_FILE = LockPerformanceTests/Info.plist; 461 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 462 | PRODUCT_BUNDLE_IDENTIFIER = com.mali.LockPerformanceTests; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TARGETED_DEVICE_FAMILY = "1,2"; 465 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LockPerformance.app/LockPerformance"; 466 | }; 467 | name = Debug; 468 | }; 469 | 2466DE952041153C0002C569 /* Release */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | BUNDLE_LOADER = "$(TEST_HOST)"; 473 | CODE_SIGN_STYLE = Automatic; 474 | INFOPLIST_FILE = LockPerformanceTests/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 476 | PRODUCT_BUNDLE_IDENTIFIER = com.mali.LockPerformanceTests; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | TARGETED_DEVICE_FAMILY = "1,2"; 479 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LockPerformance.app/LockPerformance"; 480 | }; 481 | name = Release; 482 | }; 483 | 2466DE972041153C0002C569 /* Debug */ = { 484 | isa = XCBuildConfiguration; 485 | buildSettings = { 486 | CODE_SIGN_STYLE = Automatic; 487 | INFOPLIST_FILE = LockPerformanceUITests/Info.plist; 488 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 489 | PRODUCT_BUNDLE_IDENTIFIER = com.mali.LockPerformanceUITests; 490 | PRODUCT_NAME = "$(TARGET_NAME)"; 491 | TARGETED_DEVICE_FAMILY = "1,2"; 492 | TEST_TARGET_NAME = LockPerformance; 493 | }; 494 | name = Debug; 495 | }; 496 | 2466DE982041153C0002C569 /* Release */ = { 497 | isa = XCBuildConfiguration; 498 | buildSettings = { 499 | CODE_SIGN_STYLE = Automatic; 500 | INFOPLIST_FILE = LockPerformanceUITests/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 502 | PRODUCT_BUNDLE_IDENTIFIER = com.mali.LockPerformanceUITests; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | TARGETED_DEVICE_FAMILY = "1,2"; 505 | TEST_TARGET_NAME = LockPerformance; 506 | }; 507 | name = Release; 508 | }; 509 | /* End XCBuildConfiguration section */ 510 | 511 | /* Begin XCConfigurationList section */ 512 | 2466DE5F2041153B0002C569 /* Build configuration list for PBXProject "LockPerformance" */ = { 513 | isa = XCConfigurationList; 514 | buildConfigurations = ( 515 | 2466DE8E2041153C0002C569 /* Debug */, 516 | 2466DE8F2041153C0002C569 /* Release */, 517 | ); 518 | defaultConfigurationIsVisible = 0; 519 | defaultConfigurationName = Release; 520 | }; 521 | 2466DE902041153C0002C569 /* Build configuration list for PBXNativeTarget "LockPerformance" */ = { 522 | isa = XCConfigurationList; 523 | buildConfigurations = ( 524 | 2466DE912041153C0002C569 /* Debug */, 525 | 2466DE922041153C0002C569 /* Release */, 526 | ); 527 | defaultConfigurationIsVisible = 0; 528 | defaultConfigurationName = Release; 529 | }; 530 | 2466DE932041153C0002C569 /* Build configuration list for PBXNativeTarget "LockPerformanceTests" */ = { 531 | isa = XCConfigurationList; 532 | buildConfigurations = ( 533 | 2466DE942041153C0002C569 /* Debug */, 534 | 2466DE952041153C0002C569 /* Release */, 535 | ); 536 | defaultConfigurationIsVisible = 0; 537 | defaultConfigurationName = Release; 538 | }; 539 | 2466DE962041153C0002C569 /* Build configuration list for PBXNativeTarget "LockPerformanceUITests" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 2466DE972041153C0002C569 /* Debug */, 543 | 2466DE982041153C0002C569 /* Release */, 544 | ); 545 | defaultConfigurationIsVisible = 0; 546 | defaultConfigurationName = Release; 547 | }; 548 | /* End XCConfigurationList section */ 549 | }; 550 | rootObject = 2466DE5C2041153B0002C569 /* Project object */; 551 | } 552 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LockPerformance 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LockPerformance 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LockPerformance 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LockPerformance 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | 10 | #import "ViewController.h" 11 | #import 12 | #import 13 | #import 14 | #import 15 | 16 | typedef NS_ENUM(NSUInteger, LockType) { 17 | LockTypeOSSpinLock = 0, 18 | LockTypedispatch_semaphore, 19 | LockTypepthread_mutex, 20 | LockTypeNSCondition, 21 | LockTypeNSLock, 22 | LockTypepthread_mutex_recursive, 23 | LockTypeNSRecursiveLock, 24 | LockTypeNSConditionLock, 25 | LockTypesynchronized, 26 | LockTypepthread_rwlock, 27 | LockTypeos_unfair_lock, 28 | LockTypeCount, 29 | }; 30 | 31 | 32 | NSTimeInterval TimeCosts[LockTypeCount] = {0}; 33 | int TimeCount = 0; 34 | 35 | @interface ViewController () 36 | 37 | @end 38 | 39 | @implementation ViewController 40 | 41 | - (void)viewDidLoad { 42 | [super viewDidLoad]; 43 | 44 | int buttonCount = 5; 45 | for (int i = 0; i < buttonCount; i++) { 46 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 47 | button.frame = CGRectMake(0, 0, 200, 50); 48 | button.center = CGPointMake(self.view.frame.size.width / 2, i * 60 + 160); 49 | button.tag = pow(10, i + 3); 50 | [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; 51 | [button setTitle:[NSString stringWithFormat:@"run (%d)",(int)button.tag] forState:UIControlStateNormal]; 52 | [button addTarget:self action:@selector(tap:) forControlEvents:UIControlEventTouchUpInside]; 53 | [self.view addSubview:button]; 54 | } 55 | 56 | UIButton *logButton = [UIButton buttonWithType:UIButtonTypeCustom]; 57 | logButton.frame = CGRectMake(15, [[UIScreen mainScreen] bounds].size.height - 100, 100, 50); 58 | [logButton setTitle:@"All Costs" forState:UIControlStateNormal]; 59 | [logButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 60 | [logButton addTarget:self action:@selector(log:) forControlEvents:UIControlEventTouchUpInside]; 61 | [self.view addSubview:logButton]; 62 | 63 | UIButton *clearButton = [UIButton buttonWithType:UIButtonTypeCustom]; 64 | clearButton.frame = CGRectMake([[UIScreen mainScreen] bounds].size.width-115, [[UIScreen mainScreen] bounds].size.height - 100, 100, 50); 65 | [clearButton setTitle:@"Clear " forState:UIControlStateNormal]; 66 | [clearButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 67 | [clearButton addTarget:self action:@selector(clear:) forControlEvents:UIControlEventTouchUpInside]; 68 | [self.view addSubview:clearButton]; 69 | } 70 | 71 | - (void)tap:(UIButton *)sender { 72 | NSLog(@""); 73 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 74 | [self test:(int)sender.tag]; 75 | }); 76 | } 77 | 78 | - (IBAction)clear:(id)sender { 79 | for (NSUInteger i = 0; i < LockTypeCount; i++) { 80 | TimeCosts[i] = 0; 81 | } 82 | TimeCount = 0; 83 | printf("---- clear ----\n\n"); 84 | } 85 | 86 | - (IBAction)log:(id)sender { 87 | [self printTimeConst:TimeCosts]; 88 | printf("---- fin (sum:%d) ----\n\n",TimeCount); 89 | } 90 | 91 | 92 | - (void)test:(int)count { 93 | NSTimeInterval begin, end; 94 | TimeCount += count; 95 | NSTimeInterval timeCosts[LockTypeCount] = {0}; 96 | 97 | { 98 | OSSpinLock lock = OS_SPINLOCK_INIT; 99 | begin = CACurrentMediaTime(); 100 | for (int i = 0; i < count; i++) { 101 | OSSpinLockLock(&lock); 102 | OSSpinLockUnlock(&lock); 103 | } 104 | end = CACurrentMediaTime(); 105 | TimeCosts[LockTypeOSSpinLock] += end - begin; 106 | timeCosts[LockTypeOSSpinLock] = end - begin; 107 | } 108 | 109 | 110 | { 111 | dispatch_semaphore_t lock = dispatch_semaphore_create(1); 112 | begin = CACurrentMediaTime(); 113 | for (int i = 0; i < count; i++) { 114 | dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); 115 | dispatch_semaphore_signal(lock); 116 | } 117 | end = CACurrentMediaTime(); 118 | TimeCosts[LockTypedispatch_semaphore] += end - begin; 119 | timeCosts[LockTypedispatch_semaphore] = end - begin; 120 | } 121 | 122 | 123 | { 124 | pthread_mutex_t lock; 125 | pthread_mutex_init(&lock, NULL); 126 | begin = CACurrentMediaTime(); 127 | for (int i = 0; i < count; i++) { 128 | pthread_mutex_lock(&lock); 129 | pthread_mutex_unlock(&lock); 130 | } 131 | end = CACurrentMediaTime(); 132 | TimeCosts[LockTypepthread_mutex] += end - begin; 133 | timeCosts[LockTypepthread_mutex] = end - begin; 134 | pthread_mutex_destroy(&lock); 135 | } 136 | 137 | 138 | { 139 | NSCondition *lock = [NSCondition new]; 140 | begin = CACurrentMediaTime(); 141 | for (int i = 0; i < count; i++) { 142 | [lock lock]; 143 | [lock unlock]; 144 | } 145 | end = CACurrentMediaTime(); 146 | TimeCosts[LockTypeNSCondition] += end - begin; 147 | timeCosts[LockTypeNSCondition] = end - begin; 148 | } 149 | 150 | 151 | { 152 | NSLock *lock = [NSLock new]; 153 | begin = CACurrentMediaTime(); 154 | for (int i = 0; i < count; i++) { 155 | [lock lock]; 156 | [lock unlock]; 157 | } 158 | end = CACurrentMediaTime(); 159 | TimeCosts[LockTypeNSLock] += end - begin; 160 | timeCosts[LockTypeNSLock] = end - begin; 161 | } 162 | 163 | 164 | { 165 | pthread_mutex_t lock; 166 | pthread_mutexattr_t attr; 167 | pthread_mutexattr_init(&attr); 168 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 169 | pthread_mutex_init(&lock, &attr); 170 | pthread_mutexattr_destroy(&attr); 171 | begin = CACurrentMediaTime(); 172 | for (int i = 0; i < count; i++) { 173 | pthread_mutex_lock(&lock); 174 | pthread_mutex_unlock(&lock); 175 | } 176 | end = CACurrentMediaTime(); 177 | TimeCosts[LockTypepthread_mutex_recursive] += end - begin; 178 | timeCosts[LockTypepthread_mutex_recursive] = end - begin; 179 | pthread_mutex_destroy(&lock); 180 | } 181 | 182 | 183 | { 184 | NSRecursiveLock *lock = [NSRecursiveLock new]; 185 | begin = CACurrentMediaTime(); 186 | for (int i = 0; i < count; i++) { 187 | [lock lock]; 188 | [lock unlock]; 189 | } 190 | end = CACurrentMediaTime(); 191 | TimeCosts[LockTypeNSRecursiveLock] += end - begin; 192 | timeCosts[LockTypeNSRecursiveLock] = end - begin; 193 | } 194 | 195 | { 196 | NSConditionLock *lock = [[NSConditionLock alloc] initWithCondition:1]; 197 | begin = CACurrentMediaTime(); 198 | for (int i = 0; i < count; i++) { 199 | [lock lock]; 200 | [lock unlock]; 201 | } 202 | end = CACurrentMediaTime(); 203 | TimeCosts[LockTypeNSConditionLock] += end - begin; 204 | timeCosts[LockTypeNSConditionLock] = end - begin; 205 | } 206 | 207 | { 208 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; 209 | begin = CACurrentMediaTime(); 210 | for (int i = 0; i < count; i++) { 211 | pthread_rwlock_wrlock(&rwlock); 212 | pthread_rwlock_unlock(&rwlock); 213 | } 214 | end = CACurrentMediaTime(); 215 | TimeCosts[LockTypepthread_rwlock] += end - begin; 216 | timeCosts[LockTypepthread_rwlock] = end - begin; 217 | } 218 | 219 | { 220 | os_unfair_lock_t unfairLock; 221 | unfairLock = &(OS_UNFAIR_LOCK_INIT); 222 | begin = CACurrentMediaTime(); 223 | for (int i = 0; i < count; i++) { 224 | os_unfair_lock_lock(unfairLock); 225 | os_unfair_lock_unlock(unfairLock); 226 | } 227 | end = CACurrentMediaTime(); 228 | TimeCosts[LockTypeos_unfair_lock] += end - begin; 229 | timeCosts[LockTypeos_unfair_lock] = end - begin; 230 | 231 | } 232 | 233 | { 234 | NSObject *lock = [NSObject new]; 235 | begin = CACurrentMediaTime(); 236 | for (int i = 0; i < count; i++) { 237 | @synchronized(lock) {} 238 | } 239 | end = CACurrentMediaTime(); 240 | TimeCosts[LockTypesynchronized] += end - begin; 241 | timeCosts[LockTypesynchronized] = end - begin; 242 | } 243 | 244 | [self printTimeConst:timeCosts]; 245 | 246 | printf("---- fin (%d) ----\n\n",count); 247 | } 248 | 249 | - (void)printTimeConst:(NSTimeInterval *)timeCosts { 250 | NSString *OSSpinLock = [NSString stringWithFormat:@"OSSpinLock: %8.2f ms\n", timeCosts[LockTypeOSSpinLock] * 1000]; 251 | NSString *dispatch_semaphore = [NSString stringWithFormat:@"dispatch_semaphore: %8.2f ms\n", timeCosts[LockTypedispatch_semaphore] * 1000]; 252 | NSString *pthread_mutex = [NSString stringWithFormat:@"pthread_mutex: %8.2f ms\n", timeCosts[LockTypepthread_mutex] * 1000]; 253 | NSString *NSCondition = [NSString stringWithFormat:@"NSCondition: %8.2f ms\n", timeCosts[LockTypeNSCondition] * 1000]; 254 | NSString *NSLock = [NSString stringWithFormat:@"NSLock: %8.2f ms\n", timeCosts[LockTypeNSLock] * 1000]; 255 | NSString *pthread_mutex_recursive = [NSString stringWithFormat:@"pthread_mutex(recursive): %8.2f ms\n", timeCosts[LockTypepthread_mutex_recursive] * 1000]; 256 | NSString *NSRecursiveLock = [NSString stringWithFormat:@"NSRecursiveLock: %8.2f ms\n", timeCosts[LockTypeNSRecursiveLock] * 1000]; 257 | NSString *NSConditionLock = [NSString stringWithFormat:@"NSConditionLock: %8.2f ms\n", timeCosts[LockTypeNSConditionLock] * 1000]; 258 | NSString *pthread_rwlock = [NSString stringWithFormat:@"pthread_rwlock: %8.2f ms\n", timeCosts[LockTypepthread_rwlock] * 1000]; 259 | NSString *os_unfair_lock = [NSString stringWithFormat:@"os_unfair_lock: %8.2f ms\n", timeCosts[LockTypeos_unfair_lock] * 1000]; 260 | NSString *synchronized = [NSString stringWithFormat:@"@synchronized: %8.2f ms\n", timeCosts[LockTypesynchronized] * 1000]; 261 | 262 | NSMutableDictionary *dict = [NSMutableDictionary dictionary]; 263 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypeOSSpinLock] * 1000] forKey:OSSpinLock]; 264 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypedispatch_semaphore] * 1000] forKey:dispatch_semaphore]; 265 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypepthread_mutex] * 1000] forKey:pthread_mutex]; 266 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypeNSCondition] * 1000] forKey:NSCondition]; 267 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypeNSLock] * 1000] forKey:NSLock]; 268 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypepthread_mutex_recursive] * 1000] forKey:pthread_mutex_recursive]; 269 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypeNSRecursiveLock] * 1000] forKey:NSRecursiveLock]; 270 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypeNSConditionLock] * 1000] forKey:NSConditionLock]; 271 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypepthread_rwlock] * 1000] forKey:pthread_rwlock]; 272 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypeos_unfair_lock] * 1000] forKey:os_unfair_lock]; 273 | [dict setObject:[NSString stringWithFormat:@"%8.2f", timeCosts[LockTypesynchronized] * 1000] forKey:synchronized]; 274 | 275 | NSArray *relustArray = [dict keysSortedByValueUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { 276 | if ([obj1 doubleValue] > [obj2 doubleValue]) { 277 | return (NSComparisonResult)NSOrderedDescending; 278 | } 279 | if ([obj1 doubleValue] < [obj2 doubleValue]) { 280 | return (NSComparisonResult)NSOrderedAscending; 281 | } 282 | return (NSComparisonResult)NSOrderedSame; 283 | }]; 284 | for (NSString *string in relustArray) { 285 | printf("%s", [string UTF8String]); 286 | } 287 | } 288 | 289 | @end 290 | 291 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformance/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LockPerformance 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformanceTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformanceTests/LockPerformanceTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LockPerformanceTests.m 3 | // LockPerformanceTests 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LockPerformanceTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LockPerformanceTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformanceUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LockPerformance/LockPerformanceUITests/LockPerformanceUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LockPerformanceUITests.m 3 | // LockPerformanceUITests 4 | // 5 | // Created by MaLi on 2018/2/24. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LockPerformanceUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LockPerformanceUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LockPerformance/README.md: -------------------------------------------------------------------------------- 1 | # LockPerformance 2 | Fork from https://github.com/ibireme/tmp/tree/master/iOSLockBenckmark 3 | 4 | ![](https://raw.githubusercontent.com/maligh/ML-Objective-C-Demo/master/LockPerformance/LockPerformance.jpg) 5 | 6 | 运行环境: 7 | iphone6s plus ,系统版本:11.2.2,Xcode9.2 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MLDescription/NSObject+MLDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MLDescription.h 3 | // TestWei 4 | // 5 | // Created by MaLi on 2017/7/27. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (MLDescription) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDescription/NSObject+MLDescription.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MLDescription.m 3 | // TestWei 4 | // 5 | // Created by MaLi on 2017/7/27. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MLDescription.h" 10 | #import 11 | 12 | @implementation NSObject (MLDescription) 13 | 14 | - (NSString *)description { 15 | u_int count; 16 | objc_property_t *properties =class_copyPropertyList([self class], &count); 17 | NSMutableArray *propertiesArray = [NSMutableArray arrayWithCapacity:count]; 18 | NSMutableArray *propertiesValueArray = [NSMutableArray arrayWithCapacity:count]; 19 | for (int i = 0; i"]; 40 | return returnString; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /MLDescription/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 只是记录使用description方法的一个小idea,还没有完成,希望以后能做到跟xcode那样信息全面 3 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1051007A1F2CE6E300413971 /* Bird.m in Sources */ = {isa = PBXBuildFile; fileRef = 105100791F2CE6E300413971 /* Bird.m */; }; 11 | 1051007D1F2CED1200413971 /* Monkey.m in Sources */ = {isa = PBXBuildFile; fileRef = 1051007C1F2CED1200413971 /* Monkey.m */; }; 12 | 105CE9A91F2C5F1D00FAE87D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 105CE9A81F2C5F1D00FAE87D /* main.m */; }; 13 | 105CE9AC1F2C5F1D00FAE87D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 105CE9AB1F2C5F1D00FAE87D /* AppDelegate.m */; }; 14 | 105CE9AF1F2C5F1D00FAE87D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 105CE9AE1F2C5F1D00FAE87D /* ViewController.m */; }; 15 | 105CE9B21F2C5F1D00FAE87D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 105CE9B01F2C5F1D00FAE87D /* Main.storyboard */; }; 16 | 105CE9B41F2C5F1D00FAE87D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 105CE9B31F2C5F1D00FAE87D /* Assets.xcassets */; }; 17 | 105CE9B71F2C5F1D00FAE87D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 105CE9B51F2C5F1D00FAE87D /* LaunchScreen.storyboard */; }; 18 | 105CE9C21F2C5F1D00FAE87D /* MessageForwardingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 105CE9C11F2C5F1D00FAE87D /* MessageForwardingTests.m */; }; 19 | 105CE9CD1F2C5F1D00FAE87D /* MessageForwardingUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 105CE9CC1F2C5F1D00FAE87D /* MessageForwardingUITests.m */; }; 20 | 105CE9DC1F2C602900FAE87D /* People.m in Sources */ = {isa = PBXBuildFile; fileRef = 105CE9DB1F2C602900FAE87D /* People.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 105CE9BE1F2C5F1D00FAE87D /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 105CE99C1F2C5F1D00FAE87D /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 105CE9A31F2C5F1D00FAE87D; 29 | remoteInfo = MessageForwarding; 30 | }; 31 | 105CE9C91F2C5F1D00FAE87D /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 105CE99C1F2C5F1D00FAE87D /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 105CE9A31F2C5F1D00FAE87D; 36 | remoteInfo = MessageForwarding; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 105100781F2CE6E300413971 /* Bird.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bird.h; sourceTree = ""; }; 42 | 105100791F2CE6E300413971 /* Bird.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bird.m; sourceTree = ""; }; 43 | 1051007B1F2CED1200413971 /* Monkey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Monkey.h; sourceTree = ""; }; 44 | 1051007C1F2CED1200413971 /* Monkey.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Monkey.m; sourceTree = ""; }; 45 | 105CE9A41F2C5F1D00FAE87D /* MessageForwarding.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MessageForwarding.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 105CE9A81F2C5F1D00FAE87D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 47 | 105CE9AA1F2C5F1D00FAE87D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 105CE9AB1F2C5F1D00FAE87D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 105CE9AD1F2C5F1D00FAE87D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 50 | 105CE9AE1F2C5F1D00FAE87D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 51 | 105CE9B11F2C5F1D00FAE87D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 52 | 105CE9B31F2C5F1D00FAE87D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 105CE9B61F2C5F1D00FAE87D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 54 | 105CE9B81F2C5F1D00FAE87D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 105CE9BD1F2C5F1D00FAE87D /* MessageForwardingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MessageForwardingTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 105CE9C11F2C5F1D00FAE87D /* MessageForwardingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageForwardingTests.m; sourceTree = ""; }; 57 | 105CE9C31F2C5F1D00FAE87D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 105CE9C81F2C5F1D00FAE87D /* MessageForwardingUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MessageForwardingUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 105CE9CC1F2C5F1D00FAE87D /* MessageForwardingUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageForwardingUITests.m; sourceTree = ""; }; 60 | 105CE9CE1F2C5F1D00FAE87D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | 105CE9DA1F2C602900FAE87D /* People.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = People.h; sourceTree = ""; }; 62 | 105CE9DB1F2C602900FAE87D /* People.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = People.m; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 105CE9A11F2C5F1D00FAE87D /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 105CE9BA1F2C5F1D00FAE87D /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | 105CE9C51F2C5F1D00FAE87D /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | 105CE99B1F2C5F1D00FAE87D = { 91 | isa = PBXGroup; 92 | children = ( 93 | 105CE9A61F2C5F1D00FAE87D /* MessageForwarding */, 94 | 105CE9C01F2C5F1D00FAE87D /* MessageForwardingTests */, 95 | 105CE9CB1F2C5F1D00FAE87D /* MessageForwardingUITests */, 96 | 105CE9A51F2C5F1D00FAE87D /* Products */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | 105CE9A51F2C5F1D00FAE87D /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 105CE9A41F2C5F1D00FAE87D /* MessageForwarding.app */, 104 | 105CE9BD1F2C5F1D00FAE87D /* MessageForwardingTests.xctest */, 105 | 105CE9C81F2C5F1D00FAE87D /* MessageForwardingUITests.xctest */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | 105CE9A61F2C5F1D00FAE87D /* MessageForwarding */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 105CE9AA1F2C5F1D00FAE87D /* AppDelegate.h */, 114 | 105CE9AB1F2C5F1D00FAE87D /* AppDelegate.m */, 115 | 105CE9AD1F2C5F1D00FAE87D /* ViewController.h */, 116 | 105CE9AE1F2C5F1D00FAE87D /* ViewController.m */, 117 | 105CE9DA1F2C602900FAE87D /* People.h */, 118 | 105CE9DB1F2C602900FAE87D /* People.m */, 119 | 105100781F2CE6E300413971 /* Bird.h */, 120 | 105100791F2CE6E300413971 /* Bird.m */, 121 | 1051007B1F2CED1200413971 /* Monkey.h */, 122 | 1051007C1F2CED1200413971 /* Monkey.m */, 123 | 105CE9B01F2C5F1D00FAE87D /* Main.storyboard */, 124 | 105CE9B31F2C5F1D00FAE87D /* Assets.xcassets */, 125 | 105CE9B51F2C5F1D00FAE87D /* LaunchScreen.storyboard */, 126 | 105CE9B81F2C5F1D00FAE87D /* Info.plist */, 127 | 105CE9A71F2C5F1D00FAE87D /* Supporting Files */, 128 | ); 129 | path = MessageForwarding; 130 | sourceTree = ""; 131 | }; 132 | 105CE9A71F2C5F1D00FAE87D /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 105CE9A81F2C5F1D00FAE87D /* main.m */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | 105CE9C01F2C5F1D00FAE87D /* MessageForwardingTests */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 105CE9C11F2C5F1D00FAE87D /* MessageForwardingTests.m */, 144 | 105CE9C31F2C5F1D00FAE87D /* Info.plist */, 145 | ); 146 | path = MessageForwardingTests; 147 | sourceTree = ""; 148 | }; 149 | 105CE9CB1F2C5F1D00FAE87D /* MessageForwardingUITests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 105CE9CC1F2C5F1D00FAE87D /* MessageForwardingUITests.m */, 153 | 105CE9CE1F2C5F1D00FAE87D /* Info.plist */, 154 | ); 155 | path = MessageForwardingUITests; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | 105CE9A31F2C5F1D00FAE87D /* MessageForwarding */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = 105CE9D11F2C5F1D00FAE87D /* Build configuration list for PBXNativeTarget "MessageForwarding" */; 164 | buildPhases = ( 165 | 105CE9A01F2C5F1D00FAE87D /* Sources */, 166 | 105CE9A11F2C5F1D00FAE87D /* Frameworks */, 167 | 105CE9A21F2C5F1D00FAE87D /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = MessageForwarding; 174 | productName = MessageForwarding; 175 | productReference = 105CE9A41F2C5F1D00FAE87D /* MessageForwarding.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | 105CE9BC1F2C5F1D00FAE87D /* MessageForwardingTests */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = 105CE9D41F2C5F1D00FAE87D /* Build configuration list for PBXNativeTarget "MessageForwardingTests" */; 181 | buildPhases = ( 182 | 105CE9B91F2C5F1D00FAE87D /* Sources */, 183 | 105CE9BA1F2C5F1D00FAE87D /* Frameworks */, 184 | 105CE9BB1F2C5F1D00FAE87D /* Resources */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | 105CE9BF1F2C5F1D00FAE87D /* PBXTargetDependency */, 190 | ); 191 | name = MessageForwardingTests; 192 | productName = MessageForwardingTests; 193 | productReference = 105CE9BD1F2C5F1D00FAE87D /* MessageForwardingTests.xctest */; 194 | productType = "com.apple.product-type.bundle.unit-test"; 195 | }; 196 | 105CE9C71F2C5F1D00FAE87D /* MessageForwardingUITests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = 105CE9D71F2C5F1D00FAE87D /* Build configuration list for PBXNativeTarget "MessageForwardingUITests" */; 199 | buildPhases = ( 200 | 105CE9C41F2C5F1D00FAE87D /* Sources */, 201 | 105CE9C51F2C5F1D00FAE87D /* Frameworks */, 202 | 105CE9C61F2C5F1D00FAE87D /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | 105CE9CA1F2C5F1D00FAE87D /* PBXTargetDependency */, 208 | ); 209 | name = MessageForwardingUITests; 210 | productName = MessageForwardingUITests; 211 | productReference = 105CE9C81F2C5F1D00FAE87D /* MessageForwardingUITests.xctest */; 212 | productType = "com.apple.product-type.bundle.ui-testing"; 213 | }; 214 | /* End PBXNativeTarget section */ 215 | 216 | /* Begin PBXProject section */ 217 | 105CE99C1F2C5F1D00FAE87D /* Project object */ = { 218 | isa = PBXProject; 219 | attributes = { 220 | LastUpgradeCheck = 0830; 221 | ORGANIZATIONNAME = mali; 222 | TargetAttributes = { 223 | 105CE9A31F2C5F1D00FAE87D = { 224 | CreatedOnToolsVersion = 8.3.3; 225 | ProvisioningStyle = Automatic; 226 | }; 227 | 105CE9BC1F2C5F1D00FAE87D = { 228 | CreatedOnToolsVersion = 8.3.3; 229 | ProvisioningStyle = Automatic; 230 | TestTargetID = 105CE9A31F2C5F1D00FAE87D; 231 | }; 232 | 105CE9C71F2C5F1D00FAE87D = { 233 | CreatedOnToolsVersion = 8.3.3; 234 | ProvisioningStyle = Automatic; 235 | TestTargetID = 105CE9A31F2C5F1D00FAE87D; 236 | }; 237 | }; 238 | }; 239 | buildConfigurationList = 105CE99F1F2C5F1D00FAE87D /* Build configuration list for PBXProject "MessageForwarding" */; 240 | compatibilityVersion = "Xcode 3.2"; 241 | developmentRegion = English; 242 | hasScannedForEncodings = 0; 243 | knownRegions = ( 244 | en, 245 | Base, 246 | ); 247 | mainGroup = 105CE99B1F2C5F1D00FAE87D; 248 | productRefGroup = 105CE9A51F2C5F1D00FAE87D /* Products */; 249 | projectDirPath = ""; 250 | projectRoot = ""; 251 | targets = ( 252 | 105CE9A31F2C5F1D00FAE87D /* MessageForwarding */, 253 | 105CE9BC1F2C5F1D00FAE87D /* MessageForwardingTests */, 254 | 105CE9C71F2C5F1D00FAE87D /* MessageForwardingUITests */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | 105CE9A21F2C5F1D00FAE87D /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 105CE9B71F2C5F1D00FAE87D /* LaunchScreen.storyboard in Resources */, 265 | 105CE9B41F2C5F1D00FAE87D /* Assets.xcassets in Resources */, 266 | 105CE9B21F2C5F1D00FAE87D /* Main.storyboard in Resources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | 105CE9BB1F2C5F1D00FAE87D /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 105CE9C61F2C5F1D00FAE87D /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXResourcesBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | 105CE9A01F2C5F1D00FAE87D /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 1051007D1F2CED1200413971 /* Monkey.m in Sources */, 292 | 1051007A1F2CE6E300413971 /* Bird.m in Sources */, 293 | 105CE9DC1F2C602900FAE87D /* People.m in Sources */, 294 | 105CE9AF1F2C5F1D00FAE87D /* ViewController.m in Sources */, 295 | 105CE9AC1F2C5F1D00FAE87D /* AppDelegate.m in Sources */, 296 | 105CE9A91F2C5F1D00FAE87D /* main.m in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | 105CE9B91F2C5F1D00FAE87D /* Sources */ = { 301 | isa = PBXSourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | 105CE9C21F2C5F1D00FAE87D /* MessageForwardingTests.m in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | 105CE9C41F2C5F1D00FAE87D /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 105CE9CD1F2C5F1D00FAE87D /* MessageForwardingUITests.m in Sources */, 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | }; 316 | /* End PBXSourcesBuildPhase section */ 317 | 318 | /* Begin PBXTargetDependency section */ 319 | 105CE9BF1F2C5F1D00FAE87D /* PBXTargetDependency */ = { 320 | isa = PBXTargetDependency; 321 | target = 105CE9A31F2C5F1D00FAE87D /* MessageForwarding */; 322 | targetProxy = 105CE9BE1F2C5F1D00FAE87D /* PBXContainerItemProxy */; 323 | }; 324 | 105CE9CA1F2C5F1D00FAE87D /* PBXTargetDependency */ = { 325 | isa = PBXTargetDependency; 326 | target = 105CE9A31F2C5F1D00FAE87D /* MessageForwarding */; 327 | targetProxy = 105CE9C91F2C5F1D00FAE87D /* PBXContainerItemProxy */; 328 | }; 329 | /* End PBXTargetDependency section */ 330 | 331 | /* Begin PBXVariantGroup section */ 332 | 105CE9B01F2C5F1D00FAE87D /* Main.storyboard */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 105CE9B11F2C5F1D00FAE87D /* Base */, 336 | ); 337 | name = Main.storyboard; 338 | sourceTree = ""; 339 | }; 340 | 105CE9B51F2C5F1D00FAE87D /* LaunchScreen.storyboard */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 105CE9B61F2C5F1D00FAE87D /* Base */, 344 | ); 345 | name = LaunchScreen.storyboard; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXVariantGroup section */ 349 | 350 | /* Begin XCBuildConfiguration section */ 351 | 105CE9CF1F2C5F1D00FAE87D /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_ANALYZER_NONNULL = YES; 356 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 358 | CLANG_CXX_LIBRARY = "libc++"; 359 | CLANG_ENABLE_MODULES = YES; 360 | CLANG_ENABLE_OBJC_ARC = YES; 361 | CLANG_WARN_BOOL_CONVERSION = YES; 362 | CLANG_WARN_CONSTANT_CONVERSION = YES; 363 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 364 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 365 | CLANG_WARN_EMPTY_BODY = YES; 366 | CLANG_WARN_ENUM_CONVERSION = YES; 367 | CLANG_WARN_INFINITE_RECURSION = YES; 368 | CLANG_WARN_INT_CONVERSION = YES; 369 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 370 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 371 | CLANG_WARN_UNREACHABLE_CODE = YES; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = NO; 375 | DEBUG_INFORMATION_FORMAT = dwarf; 376 | ENABLE_STRICT_OBJC_MSGSEND = YES; 377 | ENABLE_TESTABILITY = YES; 378 | GCC_C_LANGUAGE_STANDARD = gnu99; 379 | GCC_DYNAMIC_NO_PIC = NO; 380 | GCC_NO_COMMON_BLOCKS = YES; 381 | GCC_OPTIMIZATION_LEVEL = 0; 382 | GCC_PREPROCESSOR_DEFINITIONS = ( 383 | "DEBUG=1", 384 | "$(inherited)", 385 | ); 386 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 387 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 388 | GCC_WARN_UNDECLARED_SELECTOR = YES; 389 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 390 | GCC_WARN_UNUSED_FUNCTION = YES; 391 | GCC_WARN_UNUSED_VARIABLE = YES; 392 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 393 | MTL_ENABLE_DEBUG_INFO = YES; 394 | ONLY_ACTIVE_ARCH = YES; 395 | SDKROOT = iphoneos; 396 | }; 397 | name = Debug; 398 | }; 399 | 105CE9D01F2C5F1D00FAE87D /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | ALWAYS_SEARCH_USER_PATHS = NO; 403 | CLANG_ANALYZER_NONNULL = YES; 404 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 405 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 406 | CLANG_CXX_LIBRARY = "libc++"; 407 | CLANG_ENABLE_MODULES = YES; 408 | CLANG_ENABLE_OBJC_ARC = YES; 409 | CLANG_WARN_BOOL_CONVERSION = YES; 410 | CLANG_WARN_CONSTANT_CONVERSION = YES; 411 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 412 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INFINITE_RECURSION = YES; 416 | CLANG_WARN_INT_CONVERSION = YES; 417 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 418 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 419 | CLANG_WARN_UNREACHABLE_CODE = YES; 420 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 421 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 422 | COPY_PHASE_STRIP = NO; 423 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 424 | ENABLE_NS_ASSERTIONS = NO; 425 | ENABLE_STRICT_OBJC_MSGSEND = YES; 426 | GCC_C_LANGUAGE_STANDARD = gnu99; 427 | GCC_NO_COMMON_BLOCKS = YES; 428 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 429 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 430 | GCC_WARN_UNDECLARED_SELECTOR = YES; 431 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 432 | GCC_WARN_UNUSED_FUNCTION = YES; 433 | GCC_WARN_UNUSED_VARIABLE = YES; 434 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 435 | MTL_ENABLE_DEBUG_INFO = NO; 436 | SDKROOT = iphoneos; 437 | VALIDATE_PRODUCT = YES; 438 | }; 439 | name = Release; 440 | }; 441 | 105CE9D21F2C5F1D00FAE87D /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | INFOPLIST_FILE = MessageForwarding/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = com.SuperMario.MessageForwarding; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | }; 450 | name = Debug; 451 | }; 452 | 105CE9D31F2C5F1D00FAE87D /* Release */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 456 | INFOPLIST_FILE = MessageForwarding/Info.plist; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = com.SuperMario.MessageForwarding; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | }; 461 | name = Release; 462 | }; 463 | 105CE9D51F2C5F1D00FAE87D /* Debug */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | BUNDLE_LOADER = "$(TEST_HOST)"; 467 | INFOPLIST_FILE = MessageForwardingTests/Info.plist; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 469 | PRODUCT_BUNDLE_IDENTIFIER = com.SuperMario.MessageForwardingTests; 470 | PRODUCT_NAME = "$(TARGET_NAME)"; 471 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MessageForwarding.app/MessageForwarding"; 472 | }; 473 | name = Debug; 474 | }; 475 | 105CE9D61F2C5F1D00FAE87D /* Release */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | BUNDLE_LOADER = "$(TEST_HOST)"; 479 | INFOPLIST_FILE = MessageForwardingTests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = com.SuperMario.MessageForwardingTests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MessageForwarding.app/MessageForwarding"; 484 | }; 485 | name = Release; 486 | }; 487 | 105CE9D81F2C5F1D00FAE87D /* Debug */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | INFOPLIST_FILE = MessageForwardingUITests/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = com.SuperMario.MessageForwardingUITests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | TEST_TARGET_NAME = MessageForwarding; 495 | }; 496 | name = Debug; 497 | }; 498 | 105CE9D91F2C5F1D00FAE87D /* Release */ = { 499 | isa = XCBuildConfiguration; 500 | buildSettings = { 501 | INFOPLIST_FILE = MessageForwardingUITests/Info.plist; 502 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 503 | PRODUCT_BUNDLE_IDENTIFIER = com.SuperMario.MessageForwardingUITests; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | TEST_TARGET_NAME = MessageForwarding; 506 | }; 507 | name = Release; 508 | }; 509 | /* End XCBuildConfiguration section */ 510 | 511 | /* Begin XCConfigurationList section */ 512 | 105CE99F1F2C5F1D00FAE87D /* Build configuration list for PBXProject "MessageForwarding" */ = { 513 | isa = XCConfigurationList; 514 | buildConfigurations = ( 515 | 105CE9CF1F2C5F1D00FAE87D /* Debug */, 516 | 105CE9D01F2C5F1D00FAE87D /* Release */, 517 | ); 518 | defaultConfigurationIsVisible = 0; 519 | defaultConfigurationName = Release; 520 | }; 521 | 105CE9D11F2C5F1D00FAE87D /* Build configuration list for PBXNativeTarget "MessageForwarding" */ = { 522 | isa = XCConfigurationList; 523 | buildConfigurations = ( 524 | 105CE9D21F2C5F1D00FAE87D /* Debug */, 525 | 105CE9D31F2C5F1D00FAE87D /* Release */, 526 | ); 527 | defaultConfigurationIsVisible = 0; 528 | defaultConfigurationName = Release; 529 | }; 530 | 105CE9D41F2C5F1D00FAE87D /* Build configuration list for PBXNativeTarget "MessageForwardingTests" */ = { 531 | isa = XCConfigurationList; 532 | buildConfigurations = ( 533 | 105CE9D51F2C5F1D00FAE87D /* Debug */, 534 | 105CE9D61F2C5F1D00FAE87D /* Release */, 535 | ); 536 | defaultConfigurationIsVisible = 0; 537 | defaultConfigurationName = Release; 538 | }; 539 | 105CE9D71F2C5F1D00FAE87D /* Build configuration list for PBXNativeTarget "MessageForwardingUITests" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 105CE9D81F2C5F1D00FAE87D /* Debug */, 543 | 105CE9D91F2C5F1D00FAE87D /* Release */, 544 | ); 545 | defaultConfigurationIsVisible = 0; 546 | defaultConfigurationName = Release; 547 | }; 548 | /* End XCConfigurationList section */ 549 | }; 550 | rootObject = 105CE99C1F2C5F1D00FAE87D /* Project object */; 551 | } 552 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Assets.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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Bird.h: -------------------------------------------------------------------------------- 1 | // 2 | // Bird.h 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Bird : NSObject 12 | 13 | - (void)fly; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Bird.m: -------------------------------------------------------------------------------- 1 | // 2 | // Bird.m 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Bird.h" 10 | 11 | @implementation Bird 12 | 13 | - (void)fly { 14 | NSLog(@"I am a bird, I can fly."); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Monkey.h: -------------------------------------------------------------------------------- 1 | // 2 | // Monkey.h 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Monkey : NSObject 12 | 13 | - (void)code; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/Monkey.m: -------------------------------------------------------------------------------- 1 | // 2 | // Monkey.m 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Monkey.h" 10 | 11 | @implementation Monkey 12 | 13 | - (void)code { 14 | NSLog(@"I am a coder."); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/People.h: -------------------------------------------------------------------------------- 1 | // 2 | // People.h 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface People : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/People.m: -------------------------------------------------------------------------------- 1 | // 2 | // People.m 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "People.h" 10 | #import 11 | #import "Bird.h" 12 | #import "Monkey.h" 13 | 14 | void speak(id self, SEL _cmd){ 15 | NSLog(@"Now I can speak."); 16 | } 17 | 18 | @implementation People 19 | 20 | + (BOOL)resolveInstanceMethod:(SEL)sel { 21 | 22 | NSLog(@"resolveInstanceMethod: %@", NSStringFromSelector(sel)); 23 | if (sel == @selector(speak)) { 24 | class_addMethod([self class], sel, (IMP)speak, "V@:"); 25 | return YES; 26 | } 27 | return [super resolveInstanceMethod:sel]; 28 | } 29 | 30 | - (id)forwardingTargetForSelector:(SEL)aSelector { 31 | NSLog(@"forwardingTargetForSelector: %@", NSStringFromSelector(aSelector)); 32 | Bird *bird = [[Bird alloc] init]; 33 | if ([bird respondsToSelector: aSelector]) { 34 | return bird; 35 | } 36 | return [super forwardingTargetForSelector: aSelector]; 37 | } 38 | 39 | - (void)forwardInvocation:(NSInvocation *)anInvocation { 40 | NSLog(@"forwardInvocation: %@", NSStringFromSelector([anInvocation selector])); 41 | if ([anInvocation selector] == @selector(code)) { 42 | Monkey *monkey = [[Monkey alloc] init]; 43 | [anInvocation invokeWithTarget:monkey]; 44 | } 45 | } 46 | 47 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 48 | NSLog(@"method signature for selector: %@", NSStringFromSelector(aSelector)); 49 | if (aSelector == @selector(code)) { 50 | return [NSMethodSignature signatureWithObjCTypes:"V@:@"]; 51 | } 52 | return [super methodSignatureForSelector:aSelector]; 53 | } 54 | 55 | - (void)doesNotRecognizeSelector:(SEL)aSelector { 56 | NSLog(@"doesNotRecognizeSelector: %@", NSStringFromSelector(aSelector)); 57 | [super doesNotRecognizeSelector:aSelector]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "People.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | People *people = [[People alloc] init]; 21 | [people performSelector:@selector(speak)]; 22 | [people performSelector:@selector(fly)]; 23 | [people performSelector:@selector(code)]; 24 | } 25 | 26 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 27 | People *people = [[People alloc] init]; 28 | [people performSelector:@selector(missMethod)]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwarding/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MessageForwarding 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwardingTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwardingTests/MessageForwardingTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MessageForwardingTests.m 3 | // MessageForwardingTests 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MessageForwardingTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MessageForwardingTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwardingUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MessageForwarding/MessageForwardingUITests/MessageForwardingUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MessageForwardingUITests.m 3 | // MessageForwardingUITests 4 | // 5 | // Created by mjpc on 2017/7/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MessageForwardingUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MessageForwardingUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MessageForwarding/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 这个Demo是针对理解OC中的消息转发机制 3 | 简书中对应文章http://www.jianshu.com/p/f9bd98ad5b05 4 | 5 | [或者点击这里查看](http://www.superma.me/2017/07/30/iOS%E7%90%86%E8%A7%A3Objective-C%E4%B8%AD%E6%B6%88%E6%81%AF%E8%BD%AC%E5%8F%91%E6%9C%BA%E5%88%B6%E9%99%84Demo/) 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ML-Objective-C-Demo 2 | 这个仓库用来存放我的一些Objective-C demo 3 | 4 | Demo|Article or Description 5 | ---|--- 6 | Load+Initialize|http://www.jianshu.com/p/ffdefa76e4a2 7 | MessageForwarding | http://www.jianshu.com/p/f9bd98ad5b05 8 | LockPerformance|https://www.jianshu.com/p/b1edc6b0937a 9 | 10 | --- 11 | 12 | ⭐⭐⭐如果觉得本仓库对您有帮助,请不要吝啬你的Star⭐。您的支持将鼓励我继续创作!⭐⭐⭐ 13 | 14 | 15 | -------------------------------------------------------------------------------- /TestRefresh1/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'TestRefresh1' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | 8 | # Pods for TestRefresh1 9 | 10 | pod 'MJRefresh' 11 | 12 | target 'TestRefresh1Tests' do 13 | inherit! :search_paths 14 | # Pods for testing 15 | end 16 | 17 | target 'TestRefresh1UITests' do 18 | inherit! :search_paths 19 | # Pods for testing 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TestRefresh1 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TestRefresh1 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/LeftTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LeftTableViewController.h 3 | // TestRefresh 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LeftTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/LeftTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LeftTableViewController.m 3 | // TestRefresh 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import "LeftTableViewController.h" 10 | #import "MJRefresh.h" 11 | 12 | @interface LeftTableViewController () 13 | 14 | @end 15 | 16 | @implementation LeftTableViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | // Uncomment the following line to preserve selection between presentations. 22 | // self.clearsSelectionOnViewWillAppear = NO; 23 | 24 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 25 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 26 | __weak typeof(self)weakSelf = self; 27 | self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ 28 | [weakSelf endRefresh]; 29 | }]; 30 | } 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | - (void)endRefresh { 38 | __weak typeof(self)weakSelf = self; 39 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 40 | [weakSelf.tableView.header endRefreshing]; 41 | }); 42 | } 43 | 44 | #pragma mark - Table view data source 45 | 46 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 47 | #warning Incomplete implementation, return the number of sections 48 | return 0; 49 | } 50 | 51 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 52 | #warning Incomplete implementation, return the number of rows 53 | return 0; 54 | } 55 | 56 | /* 57 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 58 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; 59 | 60 | // Configure the cell... 61 | 62 | return cell; 63 | } 64 | */ 65 | 66 | /* 67 | // Override to support conditional editing of the table view. 68 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 69 | // Return NO if you do not want the specified item to be editable. 70 | return YES; 71 | } 72 | */ 73 | 74 | /* 75 | // Override to support editing the table view. 76 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 77 | if (editingStyle == UITableViewCellEditingStyleDelete) { 78 | // Delete the row from the data source 79 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 80 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 81 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 82 | } 83 | } 84 | */ 85 | 86 | /* 87 | // Override to support rearranging the table view. 88 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 89 | } 90 | */ 91 | 92 | /* 93 | // Override to support conditional rearranging of the table view. 94 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 95 | // Return NO if you do not want the item to be re-orderable. 96 | return YES; 97 | } 98 | */ 99 | 100 | /* 101 | #pragma mark - Navigation 102 | 103 | // In a storyboard-based application, you will often want to do a little preparation before navigation 104 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 105 | // Get the new view controller using [segue destinationViewController]. 106 | // Pass the selected object to the new view controller. 107 | } 108 | */ 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/RightTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RightTableViewController.h 3 | // TestRefresh 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RightTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/RightTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RightTableViewController.m 3 | // TestRefresh 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import "RightTableViewController.h" 10 | #import "MJRefresh.h" 11 | 12 | @interface RightTableViewController () 13 | 14 | @end 15 | 16 | @implementation RightTableViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | // Uncomment the following line to preserve selection between presentations. 22 | // self.clearsSelectionOnViewWillAppear = NO; 23 | 24 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 25 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 26 | __weak typeof(self)weakSelf = self; 27 | self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ 28 | [weakSelf endRefresh]; 29 | }]; 30 | } 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | - (void)endRefresh { 38 | __weak typeof(self)weakSelf = self; 39 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 40 | [weakSelf.tableView.header endRefreshing]; 41 | }); 42 | } 43 | 44 | #pragma mark - Table view data source 45 | 46 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 47 | #warning Incomplete implementation, return the number of sections 48 | return 0; 49 | } 50 | 51 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 52 | #warning Incomplete implementation, return the number of rows 53 | return 0; 54 | } 55 | 56 | /* 57 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 58 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; 59 | 60 | // Configure the cell... 61 | 62 | return cell; 63 | } 64 | */ 65 | 66 | /* 67 | // Override to support conditional editing of the table view. 68 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 69 | // Return NO if you do not want the specified item to be editable. 70 | return YES; 71 | } 72 | */ 73 | 74 | /* 75 | // Override to support editing the table view. 76 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 77 | if (editingStyle == UITableViewCellEditingStyleDelete) { 78 | // Delete the row from the data source 79 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 80 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 81 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 82 | } 83 | } 84 | */ 85 | 86 | /* 87 | // Override to support rearranging the table view. 88 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 89 | } 90 | */ 91 | 92 | /* 93 | // Override to support conditional rearranging of the table view. 94 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 95 | // Return NO if you do not want the item to be re-orderable. 96 | return YES; 97 | } 98 | */ 99 | 100 | /* 101 | #pragma mark - Navigation 102 | 103 | // In a storyboard-based application, you will often want to do a little preparation before navigation 104 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 105 | // Get the new view controller using [segue destinationViewController]. 106 | // Pass the selected object to the new view controller. 107 | } 108 | */ 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TestRefresh1 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TestRefresh1 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TestRefresh1 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1Tests/TestRefresh1Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestRefresh1Tests.m 3 | // TestRefresh1Tests 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestRefresh1Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TestRefresh1Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /TestRefresh1/TestRefresh1UITests/TestRefresh1UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestRefresh1UITests.m 3 | // TestRefresh1UITests 4 | // 5 | // Created by MaLi on 2018/2/5. 6 | // Copyright © 2018年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestRefresh1UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TestRefresh1UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------