Created
January 8, 2015 02:22
-
-
Save rodericj/31431d401f6ef064b475 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Internal method that sends updates to all of the device's subscribers, allowing them to act on the new information. | |
* Should be called whenever the device's state has changed or when the device has received an update. | |
*/ | |
- (void)updateAllSubscribers | |
{ | |
// Use a copy to avoid mutation while enumerating. This makes it possible to miss an update, so fix that at some | |
// point. | |
NSMutableArray * tempCopy = [self.deviceSubscribers copy]; | |
for(id<RACSubscriber> subscriber in tempCopy){ | |
[subscriber sendNext:self]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment