You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 regels
615 B

  1. // Copyright 2014 Google Inc. All Rights Reserved.
  2. #import "GADUObjectCache.h"
  3. @implementation GADUObjectCache
  4. + (instancetype)sharedInstance {
  5. static GADUObjectCache *sharedInstance;
  6. static dispatch_once_t onceToken;
  7. dispatch_once(&onceToken, ^{
  8. sharedInstance = [[self alloc] init];
  9. });
  10. return sharedInstance;
  11. }
  12. - (id)init {
  13. self = [super init];
  14. if (self) {
  15. _references = [[NSMutableDictionary alloc] init];
  16. }
  17. return self;
  18. }
  19. @end
  20. @implementation NSObject (GADUOwnershipAdditions)
  21. - (NSString *)gadu_referenceKey {
  22. return [NSString stringWithFormat:@"%p", (void *)self];
  23. }
  24. @end