Setting NSURLCache memory and disk capacity to Apple default settings

This commit is contained in:
Mattt Thompson 2012-06-26 09:37:53 -07:00
parent c6ffce05b9
commit 97900fcbfa

View file

@ -35,7 +35,7 @@
- (BOOL)application:(UIApplication *)application - (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil]; NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache]; [NSURLCache setSharedURLCache:URLCache];
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
@ -66,7 +66,7 @@ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
@synthesize tweetsArrayController = _tweetsArrayController; @synthesize tweetsArrayController = _tweetsArrayController;
- (void)applicationDidFinishLaunching:(NSNotification *)notification { - (void)applicationDidFinishLaunching:(NSNotification *)notification {
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil]; NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache]; [NSURLCache setSharedURLCache:URLCache];
[self.window makeKeyAndOrderFront:self]; [self.window makeKeyAndOrderFront:self];