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