Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #25 from dstranz/master
Browse files Browse the repository at this point in the history
Add option to preserve mutability when setting value to NSMutableArray properties
  • Loading branch information
vilanovi committed Dec 11, 2015
2 parents 38c536a + fc60582 commit 8f49e97
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions NSObject+Motis.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 8f49e97

Please sign in to comment.