@@ -29,7 +29,7 @@ private string GetObjCTypeIdentifier(OdcmObject o, bool getUnderlyingType=false)
2929 OdcmProperty prop=(OdcmProperty)o;
3030 if(prop.IsCollection && !getUnderlyingType)
3131 {
32- return GetStaticCollectionObject() ;
32+ return @"NSArray" ;
3333 }
3434
3535 return GetObjCTypeIdentifier(prop.Type,getUnderlyingType);
@@ -113,7 +113,7 @@ private string GetJsonToObjCExpressionConversion(string expr,OdcmProperty prop)
113113 if(prop.Type is OdcmEntityClass || prop.Type is OdcmMediaClass || prop.Type is OdcmComplexClass)
114114 {
115115 return String.Format(
116- @"[[{0} alloc] initWithDictionary: {1} ]",
116+ @"[[{0} alloc] initWithDictionary: {1}]",
117117 GetObjCTypeIdentifier(prop,true),
118118 expr);
119119 }
@@ -169,23 +169,21 @@ private string GetHydratedIVarFromDictionary(OdcmProperty prop)
169169 if(prop.IsCollection)
170170 {
171171 return String.Format(@"
172- NSMutableArray *{0}Collection = [NSMutableArray array];
173- NSArray *{0}s = self.dictionary[@""{1}""];
172+ NSMutableArray *{0}Result = [NSMutableArray array];
173+ NSArray *{0} = self.dictionary[@""{1}""];
174174
175- if ([{0}s isKindOfClass:[NSArray class]]){{
176- for (id {0 } in {0}s ){{
177- [{0}Collection addObject:{2 }];
178- }}
175+ if ([{0} isKindOfClass:[NSArray class]]){{
176+ for (id {2 } in {0}){{
177+ [{0}Result addObject:{3 }];
178+ }}
179179 }}
180180
181- if ([{0}Collection count] > 0){{
182- _{0} = [[{3} alloc] initWithArray:{0}Collection nextLink:self.dictionary[@""@nextLink""] additionalData:self.dictionary];
183- }}
181+ _{0} = {0}Result;
184182 ",
185183 GetObjCProperty(prop),
186184 prop.Name,
187- GetJsonToObjCExpressionConversion(GetObjCProperty( prop), prop ),
188- GetStaticCollectionObject( ));
185+ prop.Type.Name.ToLowerFirstChar( ),
186+ GetJsonToObjCExpressionConversion(prop.Type.Name.ToLowerFirstChar(), prop ));
189187 }
190188
191189 return String.Format(@"_{0} = {1};",GetObjCProperty(prop),GetHydratedPropertyFromDictionary(prop));
0 commit comments