Skip to content

Commit 61c01ec

Browse files
authored
Merge pull request #672 from wolfcon/fix/functionName
Change some function name that will be redundant with other SDK
2 parents 96b7ca1 + dfa1337 commit 61c01ec

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

MJExtension.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
01DD48142248BDB6003A69A6 /* MJExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01DD480A2248BDB5003A69A6 /* MJExtension.framework */; };
1110
01DD48192248BDB6003A69A6 /* MJExtensionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01DD48182248BDB6003A69A6 /* MJExtensionTests.m */; };
1211
01DD481B2248BDB6003A69A6 /* MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 01DD480D2248BDB5003A69A6 /* MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
1312
01DD48382248BFF7003A69A6 /* MJProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 01DD48242248BFF6003A69A6 /* MJProperty.m */; };
@@ -93,7 +92,6 @@
9392
isa = PBXFrameworksBuildPhase;
9493
buildActionMask = 2147483647;
9594
files = (
96-
01DD48142248BDB6003A69A6 /* MJExtension.framework in Frameworks */,
9795
);
9896
runOnlyForDeploymentPostprocessing = 0;
9997
};

MJExtension.xcodeproj/xcshareddata/xcschemes/MJExtension.xcscheme

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,37 @@
2929
enableThreadSanitizer = "YES"
3030
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<Testables>
32+
<TestableReference
33+
skipped = "NO">
34+
<BuildableReference
35+
BuildableIdentifier = "primary"
36+
BlueprintIdentifier = "01DD48122248BDB6003A69A6"
37+
BuildableName = "MJExtensionTests.xctest"
38+
BlueprintName = "MJExtensionTests"
39+
ReferencedContainer = "container:MJExtension.xcodeproj">
40+
</BuildableReference>
41+
</TestableReference>
3242
</Testables>
43+
<MacroExpansion>
44+
<BuildableReference
45+
BuildableIdentifier = "primary"
46+
BlueprintIdentifier = "01DD48092248BDB5003A69A6"
47+
BuildableName = "MJExtension.framework"
48+
BlueprintName = "MJExtension"
49+
ReferencedContainer = "container:MJExtension.xcodeproj">
50+
</BuildableReference>
51+
</MacroExpansion>
3352
<AdditionalOptions>
3453
</AdditionalOptions>
3554
</TestAction>
3655
<LaunchAction
3756
buildConfiguration = "Debug"
3857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40-
enableThreadSanitizer = "YES"
4159
launchStyle = "0"
4260
useCustomWorkingDirectory = "NO"
4361
ignoresPersistentStateOnLaunch = "NO"
4462
debugDocumentVersioning = "YES"
45-
stopOnEveryThreadSanitizerIssue = "YES"
4663
debugServiceExtension = "internal"
4764
allowLocationSimulation = "YES">
4865
<MacroExpansion>

MJExtension/MJExtension.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
#import "NSObject+MJKeyValue.h"
1414
#import "NSString+MJExtension.h"
1515
#import "MJExtensionConst.h"
16+
17+
#import "MJFoundation.h"

MJExtension/NSObject+MJProperty.m

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
@implementation NSObject (Property)
2929

30-
+ (NSMutableDictionary *)propertyDictForKey:(const void *)key
30+
+ (NSMutableDictionary *)mj_propertyDictForKey:(const void *)key
3131
{
3232
static NSMutableDictionary *replacedKeyFromPropertyNameDict;
3333
static NSMutableDictionary *replacedKeyFromPropertyName121Dict;
@@ -53,7 +53,7 @@ + (NSMutableDictionary *)propertyDictForKey:(const void *)key
5353
}
5454

5555
#pragma mark - --私有方法--
56-
+ (id)propertyKey:(NSString *)propertyName
56+
+ (id)mj_propertyKey:(NSString *)propertyName
5757
{
5858
MJExtensionAssertParamNotNil2(propertyName, nil);
5959

@@ -103,7 +103,7 @@ + (id)propertyKey:(NSString *)propertyName
103103
return key;
104104
}
105105

106-
+ (Class)propertyObjectClassInArray:(NSString *)propertyName
106+
+ (Class)mj_propertyObjectClassInArray:(NSString *)propertyName
107107
{
108108
__block id clazz = nil;
109109
if ([self respondsToSelector:@selector(mj_objectClassInArray)]) {
@@ -137,7 +137,7 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
137137
// 获得成员变量
138138
MJExtensionSemaphoreCreate
139139
MJExtensionSemaphoreWait
140-
NSArray *cachedProperties = [self properties];
140+
NSArray *cachedProperties = [self mj_properties];
141141
MJExtensionSemaphoreSignal
142142
// 遍历成员变量
143143
BOOL stop = NO;
@@ -148,9 +148,9 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
148148
}
149149

150150
#pragma mark - 公共方法
151-
+ (NSMutableArray *)properties
151+
+ (NSMutableArray *)mj_properties
152152
{
153-
NSMutableArray *cachedProperties = [self propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)];
153+
NSMutableArray *cachedProperties = [self mj_propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)];
154154
if (cachedProperties == nil) {
155155

156156
if (cachedProperties == nil) {
@@ -170,16 +170,16 @@ + (NSMutableArray *)properties
170170
if ([MJFoundation isFromNSObjectProtocolProperty:property.name]) continue;
171171

172172
property.srcClass = c;
173-
[property setOriginKey:[self propertyKey:property.name] forClass:self];
174-
[property setObjectClassInArray:[self propertyObjectClassInArray:property.name] forClass:self];
173+
[property setOriginKey:[self mj_propertyKey:property.name] forClass:self];
174+
[property setObjectClassInArray:[self mj_propertyObjectClassInArray:property.name] forClass:self];
175175
[cachedProperties addObject:property];
176176
}
177177

178178
// 3.释放内存
179179
free(properties);
180180
}];
181181

182-
[self propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)] = cachedProperties;
182+
[self mj_propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)] = cachedProperties;
183183
}
184184
}
185185

@@ -221,7 +221,7 @@ + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray
221221

222222
MJExtensionSemaphoreCreate
223223
MJExtensionSemaphoreWait
224-
[[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
224+
[[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
225225
MJExtensionSemaphoreSignal
226226
}
227227

@@ -232,7 +232,7 @@ + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)repla
232232

233233
MJExtensionSemaphoreCreate
234234
MJExtensionSemaphoreWait
235-
[[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
235+
[[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
236236
MJExtensionSemaphoreSignal
237237
}
238238

@@ -242,7 +242,7 @@ + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121
242242

243243
MJExtensionSemaphoreCreate
244244
MJExtensionSemaphoreWait
245-
[[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
245+
[[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
246246
MJExtensionSemaphoreSignal
247247
}
248248
@end

0 commit comments

Comments
 (0)