27
27
28
28
@implementation NSObject (Property)
29
29
30
- + (NSMutableDictionary *)propertyDictForKey : (const void *)key
30
+ + (NSMutableDictionary *)mj_propertyDictForKey : (const void *)key
31
31
{
32
32
static NSMutableDictionary *replacedKeyFromPropertyNameDict;
33
33
static NSMutableDictionary *replacedKeyFromPropertyName121Dict;
@@ -53,7 +53,7 @@ + (NSMutableDictionary *)propertyDictForKey:(const void *)key
53
53
}
54
54
55
55
#pragma mark - --私有方法--
56
- + (id )propertyKey : (NSString *)propertyName
56
+ + (id )mj_propertyKey : (NSString *)propertyName
57
57
{
58
58
MJExtensionAssertParamNotNil2 (propertyName, nil );
59
59
@@ -103,7 +103,7 @@ + (id)propertyKey:(NSString *)propertyName
103
103
return key;
104
104
}
105
105
106
- + (Class )propertyObjectClassInArray : (NSString *)propertyName
106
+ + (Class )mj_propertyObjectClassInArray : (NSString *)propertyName
107
107
{
108
108
__block id clazz = nil ;
109
109
if ([self respondsToSelector: @selector (mj_objectClassInArray )]) {
@@ -137,7 +137,7 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
137
137
// 获得成员变量
138
138
MJExtensionSemaphoreCreate
139
139
MJExtensionSemaphoreWait
140
- NSArray *cachedProperties = [self properties ];
140
+ NSArray *cachedProperties = [self mj_properties ];
141
141
MJExtensionSemaphoreSignal
142
142
// 遍历成员变量
143
143
BOOL stop = NO ;
@@ -148,9 +148,9 @@ + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration
148
148
}
149
149
150
150
#pragma mark - 公共方法
151
- + (NSMutableArray *)properties
151
+ + (NSMutableArray *)mj_properties
152
152
{
153
- NSMutableArray *cachedProperties = [self propertyDictForKey : &MJCachedPropertiesKey][NSStringFromClass (self )];
153
+ NSMutableArray *cachedProperties = [self mj_propertyDictForKey : &MJCachedPropertiesKey][NSStringFromClass (self )];
154
154
if (cachedProperties == nil ) {
155
155
156
156
if (cachedProperties == nil ) {
@@ -170,16 +170,16 @@ + (NSMutableArray *)properties
170
170
if ([MJFoundation isFromNSObjectProtocolProperty: property.name]) continue ;
171
171
172
172
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 ];
175
175
[cachedProperties addObject: property];
176
176
}
177
177
178
178
// 3.释放内存
179
179
free (properties);
180
180
}];
181
181
182
- [self propertyDictForKey : &MJCachedPropertiesKey][NSStringFromClass (self )] = cachedProperties;
182
+ [self mj_propertyDictForKey : &MJCachedPropertiesKey][NSStringFromClass (self )] = cachedProperties;
183
183
}
184
184
}
185
185
@@ -221,7 +221,7 @@ + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray
221
221
222
222
MJExtensionSemaphoreCreate
223
223
MJExtensionSemaphoreWait
224
- [[self propertyDictForKey : &MJCachedPropertiesKey] removeAllObjects ];
224
+ [[self mj_propertyDictForKey : &MJCachedPropertiesKey] removeAllObjects ];
225
225
MJExtensionSemaphoreSignal
226
226
}
227
227
@@ -232,7 +232,7 @@ + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)repla
232
232
233
233
MJExtensionSemaphoreCreate
234
234
MJExtensionSemaphoreWait
235
- [[self propertyDictForKey : &MJCachedPropertiesKey] removeAllObjects ];
235
+ [[self mj_propertyDictForKey : &MJCachedPropertiesKey] removeAllObjects ];
236
236
MJExtensionSemaphoreSignal
237
237
}
238
238
@@ -242,7 +242,7 @@ + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121
242
242
243
243
MJExtensionSemaphoreCreate
244
244
MJExtensionSemaphoreWait
245
- [[self propertyDictForKey : &MJCachedPropertiesKey] removeAllObjects ];
245
+ [[self mj_propertyDictForKey : &MJCachedPropertiesKey] removeAllObjects ];
246
246
MJExtensionSemaphoreSignal
247
247
}
248
248
@end
0 commit comments