ios - How to get list all requests in UIWebView? -
i want list of requests (image/video/css) in uiwebview. make podclass nsurlcache, , it's working, crash.
code:
#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
init:
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { cacheproxy *cache = [[cacheproxy alloc] initwithmemorycapacity:100 * 1024 * 1024 diskcapacity:0 diskpath:nil]; [nsurlcache setsharedurlcache:cache]; }
crash:
cfnetwork`__cfurlcache::setmemorylimit(long, long):
try optimizing nsurlcache:
http://twobitlabs.com/2012/01/ios-ipad-iphone-nsurlcache-uiwebview-memory-utilization/
Comments
Post a Comment