File tree Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -64,26 +64,6 @@ - (id)initWithDictionary:(NSDictionary*)dict withLinked:(NSDictionary*)linked {
64
64
[self setWithDictionary: dict];
65
65
[self linkLinks: linked];
66
66
67
-
68
- for (NSString *key in [self mapKeysToProperties ]) {
69
- if ([key hasPrefix: @" links." ] == YES ) {
70
-
71
- NSString *propertyName = [[self mapKeysToProperties ] objectForKey: key];
72
- NSString *linkedResource = [key stringByReplacingOccurrencesOfString: @" links." withString: @" " ];
73
-
74
- id resource = [self linkedResourceForKey: linkedResource];
75
- if (resource != nil ) {
76
- @try {
77
- [self setValue: resource forKey: propertyName];
78
- }
79
- @catch (NSException *exception) {
80
- NSLog (@" JSONAPIResource Warning - %@ " , [exception description ]);
81
- }
82
- }
83
-
84
- }
85
- }
86
-
87
67
}
88
68
return self;
89
69
}
@@ -174,6 +154,26 @@ - (void)linkLinks:(NSDictionary*)linked {
174
154
175
155
}
176
156
}
157
+
158
+ // Link links for mapped key to properties
159
+ for (NSString *key in [self mapKeysToProperties ]) {
160
+ if ([key hasPrefix: @" links." ] == YES ) {
161
+
162
+ NSString *propertyName = [[self mapKeysToProperties ] objectForKey: key];
163
+ NSString *linkedResource = [key stringByReplacingOccurrencesOfString: @" links." withString: @" " ];
164
+
165
+ id resource = [self linkedResourceForKey: linkedResource];
166
+ if (resource != nil ) {
167
+ @try {
168
+ [self setValue: resource forKey: propertyName];
169
+ }
170
+ @catch (NSException *exception) {
171
+ NSLog (@" JSONAPIResource Warning - %@ " , [exception description ]);
172
+ }
173
+ }
174
+
175
+ }
176
+ }
177
177
}
178
178
179
179
@end
You can’t perform that action at this time.
0 commit comments