试试重载uiurlcache
#import "HPURLCache.h"
@
implementation HPURLCache
- (NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request {
NSString *pathString = [[request URL] absoluteString];
NSLog(@"request %@",pathString);
if ([pathString hasSuffix:@"scriptstyle_1_post.css?i5D"]) {
NSData *css = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"scriptstyle_1_post" ofType:@"css"]];
NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[request URL]
MIMEType:@"text/css"
expectedContentLength:[css length]
textEncodingName:nil];
return [[NSCachedURLResponse alloc] initWithResponse:response data:css];
}
return [super cachedResponseForRequest:request];
}