diff --git a/Hive/Backend/BCClient.m b/Hive/Backend/BCClient.m index 34743344..b37014ed 100644 --- a/Hive/Backend/BCClient.m +++ b/Hive/Backend/BCClient.m @@ -25,7 +25,7 @@ @interface BCClient () { @property (nonatomic, assign) uint64 availableBalance; @property (nonatomic, assign) uint64 estimatedBalance; -@property (nonatomic, strong, readonly) NSMutableSet *transactionObservers; +@property (nonatomic, strong, readonly) NSHashTable *transactionObservers; @end @@ -80,7 +80,7 @@ - (instancetype)initWithBaseURL:(NSURL *)URL { }); }; - _transactionObservers = [NSMutableSet new]; + _transactionObservers = [NSHashTable weakObjectsHashTable]; if (DEBUG_OPTION_ENABLED(TESTING_NETWORK)) { bitcoin.testingNetwork = YES; diff --git a/Hive/Backend/HIExchangeRateService.m b/Hive/Backend/HIExchangeRateService.m index dc90d1b5..288a583b 100644 --- a/Hive/Backend/HIExchangeRateService.m +++ b/Hive/Backend/HIExchangeRateService.m @@ -16,7 +16,7 @@ @interface HIExchangeRateService () { } @property (nonatomic, strong) AFHTTPClient *client; -@property (nonatomic, strong) NSMutableSet *observers; +@property (nonatomic, strong) NSHashTable *observers; @property (nonatomic, strong) NSMutableDictionary *exchangeRates; @property (nonatomic, copy) NSDate *lastUpdate; @@ -41,7 +41,7 @@ - (instancetype)init { if (self) { self.client = [BCClient sharedClient]; - self.observers = [NSMutableSet new]; + self.observers = [NSHashTable weakObjectsHashTable]; self.exchangeRates = [NSMutableDictionary new]; self.lastUpdate = [NSDate dateWithTimeIntervalSince1970:0]; diff --git a/Hive/Backend/HINameFormatService.m b/Hive/Backend/HINameFormatService.m index c6402b8d..33a3d4f9 100644 --- a/Hive/Backend/HINameFormatService.m +++ b/Hive/Backend/HINameFormatService.m @@ -7,7 +7,7 @@ @interface HINameFormatService() -@property (nonatomic, strong) NSMutableSet *observers; +@property (nonatomic, strong) NSHashTable *observers; @end @@ -28,7 +28,7 @@ - (id)init { self = [super init]; if (self) { - _observers = [NSMutableSet new]; + _observers = [NSHashTable weakObjectsHashTable]; [[NSUserDefaults standardUserDefaults] registerDefaults:@{ LastNameFirstDefaultsKey: @0 }]; [[NSUserDefaults standardUserDefaults] addObserver:self