I've got a simple view controller with an NSMutableSet property called selectedEmails
. In viewDidLoad
I create the empty set and subscribe to changes:
self.selectedEmails = [NSMutableSet set];
[RACObserve(self, selectedEmails) subscribeNext:^(id emails) {
NSLog(@"set: %@", emails);
}];
For debugging purposes, I then add an item to the set in viewDidAppear:
. However, the subscription block only fires once, for the initial empty set, and never for the new, updated set.
Why is this? How can I fix it so I can observe the changes? I see in the answer to a different question that you can't observe a set but only the class that contains it – does that means that ReactiveCocoa won't work on sets?