我想獲取UIWebView中的所有請求列表(圖像/視頻/ CSS)。 我使podclass NSURLCache,它的工作,但我碰到。如何獲取UIWebView中的所有請求?
代碼:
#import <Foundation/Foundation.h>
@interface CacheProxy : NSURLCache
@end
#import "CacheProxy.h"
@implementation CacheProxy
- (NSCachedURLResponse*)cachedResponseForRequest:(NSURLRequest*)request
{
NSLog(@"url %@", request.URL);
return [super cachedResponseForRequest:request];
}
@end
初始化:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
CacheProxy *cache = [[CacheProxy alloc] initWithMemoryCapacity:100 * 1024 * 1024
diskCapacity:0
diskPath:nil];
[NSURLCache setSharedURLCache:cache];
}
崩潰:
CFNetwork`__CFURLCache::SetMemoryLimit(long, long):
我試過了,但它並沒有幫助 – nullproduction