@@ -241,7 +241,21 @@ private string GetStaticBaseObject()
241241
242242private string GeneratePropertyDeclarationLine(OdcmProperty prop)
243243{
244- return "@property (nonatomic, setter=" + GetObjCPropertySetter(prop) + ":, getter=" + GetObjCPropertyGetter(prop) + ") " + GetObjCTypeForVarDeclaration(prop) + " " + GetObjCProperty(prop) + ";";
244+ if(prop.IsCollection || prop.IsComplex())
245+ {
246+ if(prop.IsNullable==true)
247+ {
248+ return "@property (nullable, nonatomic, setter=" + GetObjCPropertySetter(prop) + ":, getter=" + GetObjCPropertyGetter(prop) + ") " + GetObjCTypeForVarDeclaration(prop) + " " + GetObjCProperty(prop) + ";";
249+ }
250+ else
251+ {
252+ return "@property (nonnull, nonatomic, setter=" + GetObjCPropertySetter(prop) + ":, getter=" + GetObjCPropertyGetter(prop) + ") " + GetObjCTypeForVarDeclaration(prop) + " " + GetObjCProperty(prop) + ";";
253+ }
254+ }
255+ else
256+ {
257+ return "@property (nonatomic, setter=" + GetObjCPropertySetter(prop) + ":, getter=" + GetObjCPropertyGetter(prop) + ") " + GetObjCTypeForVarDeclaration(prop) + " " + GetObjCProperty(prop) + ";";
258+ }
245259}
246260
247261private void PropertyGetterImplementation(OdcmProperty prop)
@@ -252,6 +266,17 @@ private void PropertyGetterImplementation(OdcmProperty prop)
252266<#+
253267 if(IsObjCTypeSameAsJsonType(prop.Projection.Type))
254268 {
269+ #>
270+ <#+
271+ if(prop.IsNullable==true)
272+ {
273+ #>
274+ if([[NSNull null] isEqual:self.dictionary[@"<#=prop.Name#>"]])
275+ {
276+ return nil;
277+ }
278+ <#+
279+ }
255280#>
256281 return self.dictionary[@"<#=prop.Name#>"];
257282<#+
@@ -280,6 +305,7 @@ private void PropertyGetterImplementation(OdcmProperty prop)
280305 }
281306#>
282307}
308+
283309<#+
284310}
285311
@@ -304,6 +330,7 @@ private void PropertySetterImplementation(OdcmProperty prop)
304330 }
305331#>
306332}
333+
307334<#+
308335}
309336#>
0 commit comments