I'm having a problem reacting to a value change in NSMutableArray.
I have the following (somewhat simplified) code to detect a change:
[[RACObserve(self, postedImagesIds) filter:^BOOL(NSMutableArray * postedImagesIds) {
return [postedImagesIds count] > 0;
}] subscribeNext:^(NSMutableArray * postedImagesIds) {
[self uploadFields:fields];
}];
The idea here is to call uploadFields
when there is a change in NSMutableArray postedImagesIds
. But not only when a new element is added, but also when a value is updated like so:
[self.postedImagesIds replaceObjectAtIndex:i withObject:imagePosted.imagePostedId];
Then thing is that when the value is updated, RACObserve
never knows!! Is there a way to recognize this change ?
Thanks in advance!