Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSUInteger cacheSizeMemory = 5*1024*1024; // 5 MB
- NSUInteger cacheSizeDisk = 5*1024*1024; // 5 MB
- NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"];
- [NSURLCache setSharedURLCache:sharedCache];
- NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:@"com.example.apple-samplecode.SimpleBackgroundTransfer.BackgroundSession"];
- configuration.URLCache = [NSURLCache sharedURLCache];
- configuration.requestCachePolicy = NSURLRequestReturnCacheDataElseLoad;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement