Created
December 25, 2011 12:19
-
-
Save tangqiaoboy/1519172 to your computer and use it in GitHub Desktop.
objective c test code
This file contains 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
+ (ImageCache *) sharedInstance { | |
if (instance == nil) { | |
@synchronized(self) { | |
if (instance == nil) { | |
instance = [[ImageCache alloc] init]; | |
} | |
} | |
} | |
return instance; | |
} | |
- (id) init { | |
if (self = [super init]) { | |
self.cachePath = NSTemporaryDirectory(); | |
self.fileManager = [NSFileManager defaultManager]; | |
self.memoryCache = [[NSMutableDictionary alloc] initWithCapacity:MAX_MEMORY_CACHE_NUMBER]; | |
self.memoryCacheKeys = [[NSMutableArray alloc] initWithCapacity:MAX_MEMORY_CACHE_NUMBER]; | |
return self; | |
} | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment