File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,20 @@ - (NSArray*)resourcesForKey:(NSString*)key {
97
97
return resources;
98
98
}
99
99
100
+ - (NSMutableArray *)arrayFromDictionary : (NSDictionary *)dictionary withKey : (NSString *)key
101
+ {
102
+ NSMutableArray *array = [[NSMutableArray alloc ]init];
103
+
104
+ if ([[dictionary objectForKey: key] isKindOfClass: [NSDictionary class ]]) {
105
+ [array addObject: [dictionary objectForKey: key]];
106
+ }
107
+ else {
108
+ array = [dictionary objectForKey: key];
109
+ }
110
+
111
+ return array;
112
+ }
113
+
100
114
#pragma mark - Private
101
115
102
116
- (void )inflateWithDictionary : (NSDictionary *)dictionary {
@@ -118,7 +132,7 @@ - (void)inflateWithDictionary:(NSDictionary*)dictionary {
118
132
119
133
// Loops through linked arrays
120
134
for (NSString *key in rawLinked.allKeys ) {
121
- NSArray *value = [rawLinked objectForKey : key];
135
+ NSArray *value = [self arrayFromDictionary: rawLinked withKey : key];
122
136
123
137
if ([value isKindOfClass: [NSArray class ]] == YES ) {
124
138
NSMutableDictionary *resources = [NSMutableDictionary dictionary ];
You can’t perform that action at this time.
0 commit comments