@@ -52,17 +52,16 @@ - (BOOL)setValue:(id)value ofProperty:(NSString *)property
52
52
53
53
- (id )performBoxingIfNecessary : (id )object
54
54
{
55
- return [ParseModelUtils performBoxingIfNecessary: object];
55
+ return [[ ParseModelUtils sharedUtilities ] performBoxingIfNecessary: object];
56
56
}
57
57
58
58
- (id )performUnboxingIfNecessary : (id )object targetClass : (Class )targetClass
59
59
{
60
- return [ParseModelUtils performUnboxingIfNecessary: object targetClass: targetClass];
60
+ return [[ ParseModelUtils sharedUtilities ] performUnboxingIfNecessary: object targetClass: targetClass];
61
61
}
62
62
63
63
#pragma mark - SELECTOR-TO-PROPERTY NAME MAPPING:
64
64
65
-
66
65
NS_INLINE BOOL isGetter (const char * name) {
67
66
if (!name[0 ] || name[0 ]==' _' || name[strlen (name)-1 ] == ' :' )
68
67
return NO ; // If it has parameters it's not a getter
@@ -96,8 +95,6 @@ NS_INLINE BOOL isSetter(const char* name) {
96
95
+ (NSString *) getterKey : (SEL )sel {return getterKey (sel);}
97
96
+ (NSString *) setterKey : (SEL )sel {return setterKey (sel);}
98
97
99
-
100
-
101
98
#pragma mark - GENERIC ACCESSOR METHOD IMPS:
102
99
103
100
static inline void setIdProperty (ParseModelBase *self, NSString * property, id value) {
@@ -107,7 +104,6 @@ static inline void setIdProperty(ParseModelBase *self, NSString* property, id va
107
104
108
105
#pragma mark - PROPERTY INTROSPECTION:
109
106
110
-
111
107
+ (NSSet *) propertyNames {
112
108
static NSMutableDictionary * classToNames;
113
109
if (!classToNames)
@@ -160,7 +156,6 @@ + (NSSet*) propertyNames {
160
156
return result;
161
157
}
162
158
163
-
164
159
// Look up a class's property by name, and find its type and which class declared it
165
160
static BOOL getPropertyInfo (Class cls,
166
161
NSString *propertyName,
@@ -195,7 +190,6 @@ static BOOL getPropertyInfo(Class cls,
195
190
return YES ;
196
191
}
197
192
198
-
199
193
static Class classFromType (const char * propertyType) {
200
194
size_t len = strlen (propertyType);
201
195
if (propertyType[0 ] != _C_ID || propertyType[1 ] != ' "' || propertyType[len-1 ] != ' "' )
@@ -205,7 +199,6 @@ static Class classFromType(const char* propertyType) {
205
199
return objc_getClass (className);
206
200
}
207
201
208
-
209
202
+ (Class ) classOfProperty : (NSString *)propertyName {
210
203
Class declaredInClass;
211
204
const char * propertyType;
@@ -229,7 +222,6 @@ + (IMP)impForSetterOfProperty:(NSString *)property ofClass:(Class)propertyClass
229
222
});
230
223
}
231
224
232
-
233
225
+ (IMP )impForGetterOfProperty : (NSString *)property ofType : (const char *)propertyType {
234
226
switch (propertyType[0 ]) {
235
227
case _C_ID:
@@ -322,9 +314,9 @@ + (BOOL)resolveInstanceMethod:(SEL)sel {
322
314
else {
323
315
return NO ;
324
316
}
325
-
317
+
318
+ // Create dynamic property method
326
319
if (accessor) {
327
- // NSLog(@"Creating dynamic accessor method -[%@ %s]", declaredInClass, selectorName);
328
320
class_addMethod (declaredInClass, sel, accessor, signature);
329
321
return YES ;
330
322
}
0 commit comments