if (index < 0 || index >= static_cast<int>([self count]))
return [super cy$setProperty:name to:value];
else {
- [self replaceObjectAtIndex:index withObject:value];
+ [self replaceObjectAtIndex:index withObject:(value ?: [NSNull null])];
return true;
}
}
@implementation NSMutableDictionary (Cycript)
- (bool) cy$setProperty:(NSString *)name to:(NSObject *)value {
- [self setObject:value forKey:name];
+ [self setObject:(value ?: [NSNull null]) forKey:name];
return true;
}