From dfa133730241dd0266e42d4f5129e7c62ad407e3 Mon Sep 17 00:00:00 2001
From: Frank <472730949@qq.com>
Date: Mon, 1 Apr 2019 11:20:49 +0800
Subject: [PATCH] Change some function name that will be redundant with other
SDK
---
MJExtension.xcodeproj/project.pbxproj | 2 --
.../xcschemes/MJExtension.xcscheme | 21 ++++++++++++++--
MJExtension/MJExtension.h | 2 ++
MJExtension/NSObject+MJProperty.m | 24 +++++++++----------
4 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/MJExtension.xcodeproj/project.pbxproj b/MJExtension.xcodeproj/project.pbxproj
index deb0821a..54c657b4 100644
--- a/MJExtension.xcodeproj/project.pbxproj
+++ b/MJExtension.xcodeproj/project.pbxproj
@@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
- 01DD48142248BDB6003A69A6 /* MJExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01DD480A2248BDB5003A69A6 /* MJExtension.framework */; };
01DD48192248BDB6003A69A6 /* MJExtensionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01DD48182248BDB6003A69A6 /* MJExtensionTests.m */; };
01DD481B2248BDB6003A69A6 /* MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 01DD480D2248BDB5003A69A6 /* MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
01DD48382248BFF7003A69A6 /* MJProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 01DD48242248BFF6003A69A6 /* MJProperty.m */; };
@@ -93,7 +92,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 01DD48142248BDB6003A69A6 /* MJExtension.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/MJExtension.xcodeproj/xcshareddata/xcschemes/MJExtension.xcscheme b/MJExtension.xcodeproj/xcshareddata/xcschemes/MJExtension.xcscheme
index 88f5aca1..5df21197 100644
--- a/MJExtension.xcodeproj/xcshareddata/xcschemes/MJExtension.xcscheme
+++ b/MJExtension.xcodeproj/xcshareddata/xcschemes/MJExtension.xcscheme
@@ -29,7 +29,26 @@
enableThreadSanitizer = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
+
+
+
+
+
+
+
+
@@ -37,12 +56,10 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- enableThreadSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
- stopOnEveryThreadSanitizerIssue = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
diff --git a/MJExtension/MJExtension.h b/MJExtension/MJExtension.h
index 9d7e17ae..60e9c66f 100644
--- a/MJExtension/MJExtension.h
+++ b/MJExtension/MJExtension.h
@@ -13,3 +13,5 @@
#import "NSObject+MJKeyValue.h"
#import "NSString+MJExtension.h"
#import "MJExtensionConst.h"
+
+#import "MJFoundation.h"
diff --git a/MJExtension/NSObject+MJProperty.m b/MJExtension/NSObject+MJProperty.m
index 8cf0dd31..b6467d49 100644
--- a/MJExtension/NSObject+MJProperty.m
+++ b/MJExtension/NSObject+MJProperty.m
@@ -27,7 +27,7 @@
@implementation NSObject (Property)
-+ (NSMutableDictionary *)propertyDictForKey:(const void *)key
++ (NSMutableDictionary *)mj_propertyDictForKey:(const void *)key
{
static NSMutableDictionary *replacedKeyFromPropertyNameDict;
static NSMutableDictionary *replacedKeyFromPropertyName121Dict;
@@ -53,7 +53,7 @@ + (NSMutableDictionary *)propertyDictForKey:(const void *)key
}
#pragma mark - --私有方法--
-+ (id)propertyKey:(NSString *)propertyName
++ (id)mj_propertyKey:(NSString *)propertyName
{
MJExtensionAssertParamNotNil2(propertyName, nil);
@@ -103,7 +103,7 @@ + (id)propertyKey:(NSString *)propertyName
return key;
}
-+ (Class)propertyObjectClassInArray:(NSString *)propertyName
++ (Class)mj_propertyObjectClassInArray:(NSString *)propertyName
{
__block id clazz = nil;
if ([self respondsToSelector:@selector(mj_objectClassInArray)]) {
@@ -137,7 +137,7 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
// 获得成员变量
MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
- NSArray *cachedProperties = [self properties];
+ NSArray *cachedProperties = [self mj_properties];
MJExtensionSemaphoreSignal
// 遍历成员变量
BOOL stop = NO;
@@ -148,9 +148,9 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
}
#pragma mark - 公共方法
-+ (NSMutableArray *)properties
++ (NSMutableArray *)mj_properties
{
- NSMutableArray *cachedProperties = [self propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)];
+ NSMutableArray *cachedProperties = [self mj_propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)];
if (cachedProperties == nil) {
if (cachedProperties == nil) {
@@ -170,8 +170,8 @@ + (NSMutableArray *)properties
if ([MJFoundation isFromNSObjectProtocolProperty:property.name]) continue;
property.srcClass = c;
- [property setOriginKey:[self propertyKey:property.name] forClass:self];
- [property setObjectClassInArray:[self propertyObjectClassInArray:property.name] forClass:self];
+ [property setOriginKey:[self mj_propertyKey:property.name] forClass:self];
+ [property setObjectClassInArray:[self mj_propertyObjectClassInArray:property.name] forClass:self];
[cachedProperties addObject:property];
}
@@ -179,7 +179,7 @@ + (NSMutableArray *)properties
free(properties);
}];
- [self propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)] = cachedProperties;
+ [self mj_propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)] = cachedProperties;
}
}
@@ -221,7 +221,7 @@ + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray
MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
- [[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
+ [[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
MJExtensionSemaphoreSignal
}
@@ -232,7 +232,7 @@ + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)repla
MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
- [[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
+ [[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
MJExtensionSemaphoreSignal
}
@@ -242,7 +242,7 @@ + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121
MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
- [[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
+ [[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
MJExtensionSemaphoreSignal
}
@end