1
CDuXZMAPgHp1q9ew 2014 年 6 月 5 日 试试重载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]; } |
2
nkwhya OP @wujichao 这个方法也试过了,video在simulator上都不好使,所以改成了nsurlprotocol.
你知道怎么用cfnetwork监听网络请求么 |
3
CDuXZMAPgHp1q9ew 2014 年 6 月 5 日
@nkwhya 不懂呢,我只试过替换js和css
|