Skip to content

Commit

Permalink
Merge pull request #672 from wolfcon/fix/functionName
Browse files Browse the repository at this point in the history
Change some function name that will be redundant with other SDK
  • Loading branch information
wolfcon committed Apr 2, 2019
2 parents 96b7ca1 + dfa1337 commit 61c01ec
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
2 changes: 0 additions & 2 deletions MJExtension.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -93,7 +92,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
01DD48142248BDB6003A69A6 /* MJExtension.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
21 changes: 19 additions & 2 deletions MJExtension.xcodeproj/xcshareddata/xcschemes/MJExtension.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,37 @@
enableThreadSanitizer = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01DD48122248BDB6003A69A6"
BuildableName = "MJExtensionTests.xctest"
BlueprintName = "MJExtensionTests"
ReferencedContainer = "container:MJExtension.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01DD48092248BDB5003A69A6"
BuildableName = "MJExtension.framework"
BlueprintName = "MJExtension"
ReferencedContainer = "container:MJExtension.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
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">
<MacroExpansion>
Expand Down
2 changes: 2 additions & 0 deletions MJExtension/MJExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
#import "NSObject+MJKeyValue.h"
#import "NSString+MJExtension.h"
#import "MJExtensionConst.h"

#import "MJFoundation.h"
24 changes: 12 additions & 12 deletions MJExtension/NSObject+MJProperty.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

@implementation NSObject (Property)

+ (NSMutableDictionary *)propertyDictForKey:(const void *)key
+ (NSMutableDictionary *)mj_propertyDictForKey:(const void *)key
{
static NSMutableDictionary *replacedKeyFromPropertyNameDict;
static NSMutableDictionary *replacedKeyFromPropertyName121Dict;
Expand All @@ -53,7 +53,7 @@ + (NSMutableDictionary *)propertyDictForKey:(const void *)key
}

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

Expand Down Expand Up @@ -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)]) {
Expand Down Expand Up @@ -137,7 +137,7 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
// 获得成员变量
MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
NSArray *cachedProperties = [self properties];
NSArray *cachedProperties = [self mj_properties];
MJExtensionSemaphoreSignal
// 遍历成员变量
BOOL stop = NO;
Expand All @@ -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) {
Expand All @@ -170,16 +170,16 @@ + (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];
}

// 3.释放内存
free(properties);
}];

[self propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)] = cachedProperties;
[self mj_propertyDictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)] = cachedProperties;
}
}

Expand Down Expand Up @@ -221,7 +221,7 @@ + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray

MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
[[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
[[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
MJExtensionSemaphoreSignal
}

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

MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
[[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
[[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
MJExtensionSemaphoreSignal
}

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

MJExtensionSemaphoreCreate
MJExtensionSemaphoreWait
[[self propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
[[self mj_propertyDictForKey:&MJCachedPropertiesKey] removeAllObjects];
MJExtensionSemaphoreSignal
}
@end
Expand Down

0 comments on commit 61c01ec

Please sign in to comment.