Skip to content

Commit

Permalink
Fix for CBL-ios issue 648
Browse files Browse the repository at this point in the history
  • Loading branch information
24601 committed Apr 20, 2015
1 parent 4cf8324 commit 60af6e0
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions Source/API/CBLModel+Properties.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ + (IMP) impForGetterOfProperty: (NSString*)property ofClass: (Class)propertyClas
return [receiver getArrayRelationProperty: property withModelClass: itemClass];
};
}
} else {
}
else if ( [itemClass isSubclassOfClass: [NSObject class]] && ![itemClass isSubclassOfClass:[NSDate class]])
{
return [super impForGetterOfProperty: property ofClass: propertyClass];
}
else {
// Typed array of scalar class:
ValueConverter itemConverter = valueConverterToClass(itemClass);
if (itemConverter) {
Expand All @@ -253,7 +258,12 @@ + (IMP) impForGetterOfProperty: (NSString*)property ofClass: (Class)propertyClas
impBlock = ^id(CBLModel* receiver) {
return [receiver getModelProperty: property];
};
} else {
}
else if ( [propertyClass isSubclassOfClass: [NSObject class]] && ![propertyClass isSubclassOfClass:[NSDate class]])
{
return [super impForGetterOfProperty: property ofClass: propertyClass];
}
else {
// Other property type -- use a ValueConverter if we have one:
ValueConverter converter = valueConverterToClass(propertyClass);
if (converter) {
Expand Down Expand Up @@ -300,7 +310,13 @@ + (IMP) impForSetterOfProperty: (NSString*)property ofClass: (Class)propertyClas
}
[receiver setValue: value ofProperty: property];
};
} else {
}
else if ([propertyClass isSubclassOfClass: [NSObject class]])
{
return [super impForSetterOfProperty: property ofClass: propertyClass];
}

else {
// Scalar-valued array:
impBlock = ^(CBLModel* receiver, NSArray* value) {
[receiver setValue: value ofProperty: property];
Expand All @@ -316,7 +332,12 @@ + (IMP) impForSetterOfProperty: (NSString*)property ofClass: (Class)propertyClas
}
[receiver setValue: value ofProperty: property];
};
} else {
}
else if ([propertyClass isSubclassOfClass: [NSObject class]])
{
return [super impForSetterOfProperty: property ofClass: propertyClass];
}
else {
return [super impForSetterOfProperty: property ofClass: propertyClass];
}

Expand Down

0 comments on commit 60af6e0

Please sign in to comment.