Skip to content

Commit 8eb6744

Browse files
committed
submit first version for UI project and some updates
1 parent 4f957c0 commit 8eb6744

File tree

29 files changed

+1432
-139
lines changed

29 files changed

+1432
-139
lines changed

DesignPattern/DesignPattern.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
INFOPLIST_FILE = DesignPattern/Info.plist;
507507
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
508508
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
509-
PRODUCT_BUNDLE_IDENTIFIER = Authen.2015.DesignPattern;
509+
PRODUCT_BUNDLE_IDENTIFIER = Coder4869.DesignPattern;
510510
PRODUCT_NAME = "$(TARGET_NAME)";
511511
};
512512
name = Debug;
@@ -518,7 +518,7 @@
518518
INFOPLIST_FILE = DesignPattern/Info.plist;
519519
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
520520
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
521-
PRODUCT_BUNDLE_IDENTIFIER = Authen.2015.DesignPattern;
521+
PRODUCT_BUNDLE_IDENTIFIER = Coder4869.DesignPattern;
522522
PRODUCT_NAME = "$(TARGET_NAME)";
523523
};
524524
name = Release;
@@ -528,6 +528,7 @@
528528
buildSettings = {
529529
BUNDLE_LOADER = "$(TEST_HOST)";
530530
INFOPLIST_FILE = DesignPatternTests/Info.plist;
531+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
531532
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
532533
PRODUCT_BUNDLE_IDENTIFIER = coder4869.DesignPatternTests;
533534
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -540,6 +541,7 @@
540541
buildSettings = {
541542
BUNDLE_LOADER = "$(TEST_HOST)";
542543
INFOPLIST_FILE = DesignPatternTests/Info.plist;
544+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
543545
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
544546
PRODUCT_BUNDLE_IDENTIFIER = coder4869.DesignPatternTests;
545547
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -551,6 +553,7 @@
551553
isa = XCBuildConfiguration;
552554
buildSettings = {
553555
INFOPLIST_FILE = DesignPatternUITests/Info.plist;
556+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
554557
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
555558
PRODUCT_BUNDLE_IDENTIFIER = coder4869.DesignPatternUITests;
556559
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -562,6 +565,7 @@
562565
isa = XCBuildConfiguration;
563566
buildSettings = {
564567
INFOPLIST_FILE = DesignPatternUITests/Info.plist;
568+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
565569
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
566570
PRODUCT_BUNDLE_IDENTIFIER = coder4869.DesignPatternUITests;
567571
PRODUCT_NAME = "$(TARGET_NAME)";

DesignPattern/DesignPattern/Delegate/ProxyObject.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#import <Foundation/Foundation.h>
99
#import "DemoDelegate.h"
1010

11+
//继承模式
1112
@interface ProxyObject : NSObject <DemoDelegate> { //代理对象,设置代理对象的代理资格
1213
NSString *value;
1314
}
@@ -16,3 +17,14 @@
1617
- (void)callProxy;
1718

1819
@end
20+
21+
22+
/************************************************************************************/
23+
24+
//Category分类模式
25+
@interface NSObject (Proxy) <DemoDelegate> //代理对象,设置代理对象的代理资格
26+
27+
//代理对象方法
28+
- (void)callProxy;
29+
30+
@end

DesignPattern/DesignPattern/Delegate/ProxyObject.m

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#import "ProxyObject.h"
99
#import "Consignor.h"
1010

11+
//继承模式
1112
@implementation ProxyObject
1213

1314
//代理对象方法
@@ -33,3 +34,35 @@ - (void) optionalDelegateMethod: (NSString*)fromValue
3334
}
3435

3536
@end
37+
38+
39+
40+
/************************************************************************************/
41+
42+
43+
//Category分类模式
44+
@implementation NSObject (Proxy)
45+
46+
//代理对象方法
47+
- (void)callProxy {
48+
Consignor *C = [[Consignor alloc] init];
49+
C.delegate = self;
50+
[C callConsignor];
51+
}
52+
53+
54+
#pragma mark - 实现协议方法
55+
#pragma mark - DemoDelegate method
56+
57+
-(void)requiredDelegateMethod {
58+
NSLog(@"[Delegate] 我是代理人\nRequired Method!");
59+
}
60+
61+
//此方法可以注释掉,因为此方法为可选方法
62+
- (void) optionalDelegateMethod: (NSString*)fromValue
63+
{
64+
NSLog(@"[Delegate] 我是代理人\n%@", fromValue);
65+
}
66+
67+
@end
68+

DesignPattern/DesignPattern/Test4DesignPattern.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ - (void) test4SingletonDemo {
3030

3131
//代理模式调用案例
3232
- (void) test4DelegateDemo {
33-
[[ProxyObject alloc] callProxy];
33+
// [[ProxyObject alloc] callProxy]; //继承模式
34+
35+
[[NSObject alloc] callProxy]; //Category分类模式
3436
}
3537

3638
//KVC&KVO调用案例

DesignPattern/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

RuntimeOC/README/README_DATA_STRUCT.md

Lines changed: 0 additions & 114 deletions
This file was deleted.

RuntimeOC/RuntimeOC.xcodeproj/project.pbxproj

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
1757CA411D3DBA560071BC6C /* RuntimeBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1757CA3C1D3DBA560071BC6C /* RuntimeBase.mm */; };
1818
1757CA421D3DBA560071BC6C /* RuntimeTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1757CA3E1D3DBA560071BC6C /* RuntimeTest.mm */; };
1919
1757CA431D3DBA560071BC6C /* UIViewController+RuntimeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 1757CA401D3DBA560071BC6C /* UIViewController+RuntimeVC.m */; };
20-
17EB378C1D4CE65600FEF7E9 /* README_DATA_STRUCT.md in Sources */ = {isa = PBXBuildFile; fileRef = 17EB378B1D4CE65600FEF7E9 /* README_DATA_STRUCT.md */; };
2120
/* End PBXBuildFile section */
2221

2322
/* Begin PBXContainerItemProxy section */
@@ -59,7 +58,6 @@
5958
1757CA3E1D3DBA560071BC6C /* RuntimeTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeTest.mm; sourceTree = "<group>"; };
6059
1757CA3F1D3DBA560071BC6C /* UIViewController+RuntimeVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+RuntimeVC.h"; sourceTree = "<group>"; };
6160
1757CA401D3DBA560071BC6C /* UIViewController+RuntimeVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+RuntimeVC.m"; sourceTree = "<group>"; };
62-
17EB378B1D4CE65600FEF7E9 /* README_DATA_STRUCT.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README_DATA_STRUCT.md; sourceTree = "<group>"; };
6361
/* End PBXFileReference section */
6462

6563
/* Begin PBXFrameworksBuildPhase section */
@@ -90,7 +88,6 @@
9088
1757C9FB1D3DB8B50071BC6C = {
9189
isa = PBXGroup;
9290
children = (
93-
17EB378A1D4CE63700FEF7E9 /* README */,
9491
1757CA061D3DB8B50071BC6C /* RuntimeOC */,
9592
1757CA201D3DB8B50071BC6C /* RuntimeOCTests */,
9693
1757CA2B1D3DB8B50071BC6C /* RuntimeOCUITests */,
@@ -163,14 +160,6 @@
163160
path = runtime;
164161
sourceTree = "<group>";
165162
};
166-
17EB378A1D4CE63700FEF7E9 /* README */ = {
167-
isa = PBXGroup;
168-
children = (
169-
17EB378B1D4CE65600FEF7E9 /* README_DATA_STRUCT.md */,
170-
);
171-
path = README;
172-
sourceTree = "<group>";
173-
};
174163
/* End PBXGroup section */
175164

176165
/* Begin PBXNativeTarget section */
@@ -238,7 +227,6 @@
238227
TargetAttributes = {
239228
1757CA031D3DB8B50071BC6C = {
240229
CreatedOnToolsVersion = 7.3;
241-
DevelopmentTeam = 38Y7MVWP3D;
242230
};
243231
1757CA1C1D3DB8B50071BC6C = {
244232
CreatedOnToolsVersion = 7.3;
@@ -304,7 +292,6 @@
304292
1757CA421D3DBA560071BC6C /* RuntimeTest.mm in Sources */,
305293
1757CA0F1D3DB8B50071BC6C /* ViewController.m in Sources */,
306294
1757CA411D3DBA560071BC6C /* RuntimeBase.mm in Sources */,
307-
17EB378C1D4CE65600FEF7E9 /* README_DATA_STRUCT.md in Sources */,
308295
1757CA0C1D3DB8B50071BC6C /* AppDelegate.m in Sources */,
309296
1757CA431D3DBA560071BC6C /* UIViewController+RuntimeVC.m in Sources */,
310297
1757CA091D3DB8B50071BC6C /* main.m in Sources */,
@@ -446,7 +433,7 @@
446433
INFOPLIST_FILE = RuntimeOC/Info.plist;
447434
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
448435
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
449-
PRODUCT_BUNDLE_IDENTIFIER = Authen.2015.RuntimeOC;
436+
PRODUCT_BUNDLE_IDENTIFIER = Coder4869.RuntimeOC;
450437
PRODUCT_NAME = "$(TARGET_NAME)";
451438
};
452439
name = Debug;
@@ -459,7 +446,7 @@
459446
INFOPLIST_FILE = RuntimeOC/Info.plist;
460447
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
461448
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
462-
PRODUCT_BUNDLE_IDENTIFIER = Authen.2015.RuntimeOC;
449+
PRODUCT_BUNDLE_IDENTIFIER = Coder4869.RuntimeOC;
463450
PRODUCT_NAME = "$(TARGET_NAME)";
464451
};
465452
name = Release;

0 commit comments

Comments
 (0)