Skip to content

Commit 5a1f510

Browse files
committed
Runtime相关的demo
1 parent 1d92f43 commit 5a1f510

11 files changed

Lines changed: 567 additions & 0 deletions

runtime/.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## Build generated
6+
build/
7+
.DS_Store
8+
DerivedData
9+
10+
## Various settings
11+
*.pbxuser
12+
!default.pbxuser
13+
*.mode1v3
14+
!default.mode1v3
15+
*.mode2v3
16+
!default.mode2v3
17+
*.perspectivev3
18+
!default.perspectivev3
19+
xcuserdata
20+
21+
## Other
22+
*.xccheckout
23+
*.moved-aside
24+
*.xcuserstate
25+
*.xcscmblueprint
26+
27+
## Obj-C/Swift specific
28+
*.hmap
29+
*.ipa
30+
31+
# CocoaPods
32+
#
33+
# We recommend against adding the Pods directory to your .gitignore. However
34+
# you should judge for yourself, the pros and cons are mentioned at:
35+
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36+
#
37+
#Pods/
38+
39+
# Carthage
40+
#
41+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
42+
# Carthage/Checkouts
43+
44+
Carthage/Build
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
9BE0B5D11C37B14800C33764 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE0B5D01C37B14800C33764 /* main.m */; };
11+
9BE0B5D91C37B1C000C33764 /* MethodForwardTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE0B5D81C37B1C000C33764 /* MethodForwardTest.m */; };
12+
9BE0B5DC1C37B44900C33764 /* Replacement.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE0B5DB1C37B44900C33764 /* Replacement.m */; };
13+
9BE0B5DF1C37BBF000C33764 /* MethodSwizzlingTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE0B5DE1C37BBF000C33764 /* MethodSwizzlingTest.m */; };
14+
9BE0B5E21C37BF5A00C33764 /* NSString+MyImplementation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE0B5E11C37BF5A00C33764 /* NSString+MyImplementation.m */; };
15+
/* End PBXBuildFile section */
16+
17+
/* Begin PBXCopyFilesBuildPhase section */
18+
9BE0B5CB1C37B14800C33764 /* CopyFiles */ = {
19+
isa = PBXCopyFilesBuildPhase;
20+
buildActionMask = 2147483647;
21+
dstPath = /usr/share/man/man1/;
22+
dstSubfolderSpec = 0;
23+
files = (
24+
);
25+
runOnlyForDeploymentPostprocessing = 1;
26+
};
27+
/* End PBXCopyFilesBuildPhase section */
28+
29+
/* Begin PBXFileReference section */
30+
9BE0B5CD1C37B14800C33764 /* runtime */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = runtime; sourceTree = BUILT_PRODUCTS_DIR; };
31+
9BE0B5D01C37B14800C33764 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32+
9BE0B5D71C37B1C000C33764 /* MethodForwardTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodForwardTest.h; sourceTree = "<group>"; };
33+
9BE0B5D81C37B1C000C33764 /* MethodForwardTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MethodForwardTest.m; sourceTree = "<group>"; };
34+
9BE0B5DA1C37B44900C33764 /* Replacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Replacement.h; sourceTree = "<group>"; };
35+
9BE0B5DB1C37B44900C33764 /* Replacement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Replacement.m; sourceTree = "<group>"; };
36+
9BE0B5DD1C37BBF000C33764 /* MethodSwizzlingTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodSwizzlingTest.h; sourceTree = "<group>"; };
37+
9BE0B5DE1C37BBF000C33764 /* MethodSwizzlingTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MethodSwizzlingTest.m; sourceTree = "<group>"; };
38+
9BE0B5E01C37BF5A00C33764 /* NSString+MyImplementation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MyImplementation.h"; sourceTree = "<group>"; };
39+
9BE0B5E11C37BF5A00C33764 /* NSString+MyImplementation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MyImplementation.m"; sourceTree = "<group>"; };
40+
/* End PBXFileReference section */
41+
42+
/* Begin PBXFrameworksBuildPhase section */
43+
9BE0B5CA1C37B14800C33764 /* Frameworks */ = {
44+
isa = PBXFrameworksBuildPhase;
45+
buildActionMask = 2147483647;
46+
files = (
47+
);
48+
runOnlyForDeploymentPostprocessing = 0;
49+
};
50+
/* End PBXFrameworksBuildPhase section */
51+
52+
/* Begin PBXGroup section */
53+
9BE0B5C41C37B14800C33764 = {
54+
isa = PBXGroup;
55+
children = (
56+
9BE0B5CF1C37B14800C33764 /* runtime */,
57+
9BE0B5CE1C37B14800C33764 /* Products */,
58+
);
59+
sourceTree = "<group>";
60+
};
61+
9BE0B5CE1C37B14800C33764 /* Products */ = {
62+
isa = PBXGroup;
63+
children = (
64+
9BE0B5CD1C37B14800C33764 /* runtime */,
65+
);
66+
name = Products;
67+
sourceTree = "<group>";
68+
};
69+
9BE0B5CF1C37B14800C33764 /* runtime */ = {
70+
isa = PBXGroup;
71+
children = (
72+
9BE0B5D01C37B14800C33764 /* main.m */,
73+
9BE0B5DD1C37BBF000C33764 /* MethodSwizzlingTest.h */,
74+
9BE0B5DE1C37BBF000C33764 /* MethodSwizzlingTest.m */,
75+
9BE0B5E01C37BF5A00C33764 /* NSString+MyImplementation.h */,
76+
9BE0B5E11C37BF5A00C33764 /* NSString+MyImplementation.m */,
77+
9BE0B5D71C37B1C000C33764 /* MethodForwardTest.h */,
78+
9BE0B5D81C37B1C000C33764 /* MethodForwardTest.m */,
79+
9BE0B5DA1C37B44900C33764 /* Replacement.h */,
80+
9BE0B5DB1C37B44900C33764 /* Replacement.m */,
81+
);
82+
path = runtime;
83+
sourceTree = "<group>";
84+
};
85+
/* End PBXGroup section */
86+
87+
/* Begin PBXNativeTarget section */
88+
9BE0B5CC1C37B14800C33764 /* runtime */ = {
89+
isa = PBXNativeTarget;
90+
buildConfigurationList = 9BE0B5D41C37B14800C33764 /* Build configuration list for PBXNativeTarget "runtime" */;
91+
buildPhases = (
92+
9BE0B5C91C37B14800C33764 /* Sources */,
93+
9BE0B5CA1C37B14800C33764 /* Frameworks */,
94+
9BE0B5CB1C37B14800C33764 /* CopyFiles */,
95+
);
96+
buildRules = (
97+
);
98+
dependencies = (
99+
);
100+
name = runtime;
101+
productName = runtime;
102+
productReference = 9BE0B5CD1C37B14800C33764 /* runtime */;
103+
productType = "com.apple.product-type.tool";
104+
};
105+
/* End PBXNativeTarget section */
106+
107+
/* Begin PBXProject section */
108+
9BE0B5C51C37B14800C33764 /* Project object */ = {
109+
isa = PBXProject;
110+
attributes = {
111+
LastUpgradeCheck = 0720;
112+
ORGANIZATIONNAME = "张星宇";
113+
TargetAttributes = {
114+
9BE0B5CC1C37B14800C33764 = {
115+
CreatedOnToolsVersion = 7.2;
116+
};
117+
};
118+
};
119+
buildConfigurationList = 9BE0B5C81C37B14800C33764 /* Build configuration list for PBXProject "runtime" */;
120+
compatibilityVersion = "Xcode 3.2";
121+
developmentRegion = English;
122+
hasScannedForEncodings = 0;
123+
knownRegions = (
124+
en,
125+
);
126+
mainGroup = 9BE0B5C41C37B14800C33764;
127+
productRefGroup = 9BE0B5CE1C37B14800C33764 /* Products */;
128+
projectDirPath = "";
129+
projectRoot = "";
130+
targets = (
131+
9BE0B5CC1C37B14800C33764 /* runtime */,
132+
);
133+
};
134+
/* End PBXProject section */
135+
136+
/* Begin PBXSourcesBuildPhase section */
137+
9BE0B5C91C37B14800C33764 /* Sources */ = {
138+
isa = PBXSourcesBuildPhase;
139+
buildActionMask = 2147483647;
140+
files = (
141+
9BE0B5D11C37B14800C33764 /* main.m in Sources */,
142+
9BE0B5E21C37BF5A00C33764 /* NSString+MyImplementation.m in Sources */,
143+
9BE0B5D91C37B1C000C33764 /* MethodForwardTest.m in Sources */,
144+
9BE0B5DF1C37BBF000C33764 /* MethodSwizzlingTest.m in Sources */,
145+
9BE0B5DC1C37B44900C33764 /* Replacement.m in Sources */,
146+
);
147+
runOnlyForDeploymentPostprocessing = 0;
148+
};
149+
/* End PBXSourcesBuildPhase section */
150+
151+
/* Begin XCBuildConfiguration section */
152+
9BE0B5D21C37B14800C33764 /* Debug */ = {
153+
isa = XCBuildConfiguration;
154+
buildSettings = {
155+
ALWAYS_SEARCH_USER_PATHS = NO;
156+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
157+
CLANG_CXX_LIBRARY = "libc++";
158+
CLANG_ENABLE_MODULES = YES;
159+
CLANG_ENABLE_OBJC_ARC = YES;
160+
CLANG_WARN_BOOL_CONVERSION = YES;
161+
CLANG_WARN_CONSTANT_CONVERSION = YES;
162+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
163+
CLANG_WARN_EMPTY_BODY = YES;
164+
CLANG_WARN_ENUM_CONVERSION = YES;
165+
CLANG_WARN_INT_CONVERSION = YES;
166+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
167+
CLANG_WARN_UNREACHABLE_CODE = YES;
168+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
169+
CODE_SIGN_IDENTITY = "-";
170+
COPY_PHASE_STRIP = NO;
171+
DEBUG_INFORMATION_FORMAT = dwarf;
172+
ENABLE_STRICT_OBJC_MSGSEND = YES;
173+
ENABLE_TESTABILITY = YES;
174+
GCC_C_LANGUAGE_STANDARD = gnu99;
175+
GCC_DYNAMIC_NO_PIC = NO;
176+
GCC_NO_COMMON_BLOCKS = YES;
177+
GCC_OPTIMIZATION_LEVEL = 0;
178+
GCC_PREPROCESSOR_DEFINITIONS = (
179+
"DEBUG=1",
180+
"$(inherited)",
181+
);
182+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
183+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
184+
GCC_WARN_UNDECLARED_SELECTOR = YES;
185+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
186+
GCC_WARN_UNUSED_FUNCTION = YES;
187+
GCC_WARN_UNUSED_VARIABLE = YES;
188+
MACOSX_DEPLOYMENT_TARGET = 10.11;
189+
MTL_ENABLE_DEBUG_INFO = YES;
190+
ONLY_ACTIVE_ARCH = YES;
191+
SDKROOT = macosx;
192+
};
193+
name = Debug;
194+
};
195+
9BE0B5D31C37B14800C33764 /* Release */ = {
196+
isa = XCBuildConfiguration;
197+
buildSettings = {
198+
ALWAYS_SEARCH_USER_PATHS = NO;
199+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
200+
CLANG_CXX_LIBRARY = "libc++";
201+
CLANG_ENABLE_MODULES = YES;
202+
CLANG_ENABLE_OBJC_ARC = YES;
203+
CLANG_WARN_BOOL_CONVERSION = YES;
204+
CLANG_WARN_CONSTANT_CONVERSION = YES;
205+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
206+
CLANG_WARN_EMPTY_BODY = YES;
207+
CLANG_WARN_ENUM_CONVERSION = YES;
208+
CLANG_WARN_INT_CONVERSION = YES;
209+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
210+
CLANG_WARN_UNREACHABLE_CODE = YES;
211+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
212+
CODE_SIGN_IDENTITY = "-";
213+
COPY_PHASE_STRIP = NO;
214+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
215+
ENABLE_NS_ASSERTIONS = NO;
216+
ENABLE_STRICT_OBJC_MSGSEND = YES;
217+
GCC_C_LANGUAGE_STANDARD = gnu99;
218+
GCC_NO_COMMON_BLOCKS = YES;
219+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
220+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
221+
GCC_WARN_UNDECLARED_SELECTOR = YES;
222+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
223+
GCC_WARN_UNUSED_FUNCTION = YES;
224+
GCC_WARN_UNUSED_VARIABLE = YES;
225+
MACOSX_DEPLOYMENT_TARGET = 10.11;
226+
MTL_ENABLE_DEBUG_INFO = NO;
227+
SDKROOT = macosx;
228+
};
229+
name = Release;
230+
};
231+
9BE0B5D51C37B14800C33764 /* Debug */ = {
232+
isa = XCBuildConfiguration;
233+
buildSettings = {
234+
PRODUCT_NAME = "$(TARGET_NAME)";
235+
};
236+
name = Debug;
237+
};
238+
9BE0B5D61C37B14800C33764 /* Release */ = {
239+
isa = XCBuildConfiguration;
240+
buildSettings = {
241+
PRODUCT_NAME = "$(TARGET_NAME)";
242+
};
243+
name = Release;
244+
};
245+
/* End XCBuildConfiguration section */
246+
247+
/* Begin XCConfigurationList section */
248+
9BE0B5C81C37B14800C33764 /* Build configuration list for PBXProject "runtime" */ = {
249+
isa = XCConfigurationList;
250+
buildConfigurations = (
251+
9BE0B5D21C37B14800C33764 /* Debug */,
252+
9BE0B5D31C37B14800C33764 /* Release */,
253+
);
254+
defaultConfigurationIsVisible = 0;
255+
defaultConfigurationName = Release;
256+
};
257+
9BE0B5D41C37B14800C33764 /* Build configuration list for PBXNativeTarget "runtime" */ = {
258+
isa = XCConfigurationList;
259+
buildConfigurations = (
260+
9BE0B5D51C37B14800C33764 /* Debug */,
261+
9BE0B5D61C37B14800C33764 /* Release */,
262+
);
263+
defaultConfigurationIsVisible = 0;
264+
};
265+
/* End XCConfigurationList section */
266+
};
267+
rootObject = 9BE0B5C51C37B14800C33764 /* Project object */;
268+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// MyTest.h
3+
// runtime
4+
//
5+
// Created by 张星宇 on 16/1/2.
6+
// Copyright © 2016年 张星宇. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface MethodForwardTest : NSObject
12+
13+
- (void)test;
14+
15+
@end

0 commit comments

Comments
 (0)