From 8ede9f65ec219bf06b5c402e39abaaf29af5eb71 Mon Sep 17 00:00:00 2001 From: Dominique Stranz Date: Tue, 1 Dec 2015 14:41:50 +0100 Subject: [PATCH] Add option to preserve NSArray mutability in mts_validateAutomaticallyValue --- NSObject+Motis.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/NSObject+Motis.m b/NSObject+Motis.m index 177b106..7db638a 100644 --- a/NSObject+Motis.m +++ b/NSObject+Motis.m @@ -1030,11 +1030,8 @@ - (BOOL)mts_validateAutomaticallyValue:(inout __autoreleasing id *)ioValue forKe - (BOOL)mts_validateAutomaticallyValue:(inout __autoreleasing id *)ioValue toClass:(Class)typeClass forKey:(NSString*)key { // If types match, just return - if ([*ioValue isKindOfClass:typeClass]) + if ([*ioValue isKindOfClass:typeClass] && ![*ioValue isKindOfClass:NSArray.class]) { - if ([*ioValue isKindOfClass:NSArray.class]) - [self mts_validateArrayContent:ioValue forArrayKey:key]; - return YES; } @@ -1157,6 +1154,7 @@ - (BOOL)mts_validateAutomaticallyValue:(inout __autoreleasing id *)ioValue toCla *ioValue = [NSOrderedSet orderedSetWithArray:*ioValue]; return *ioValue != nil; } + return *ioValue != nil; } else if ([*ioValue isKindOfClass:NSDictionary.class]) // <-- DICTIONARIES {