解决webView显示时候加广告问题
2016-05-18 14:52
295 查看
-(void)webViewDidStartLoad:(UIWebView *)webView{
NSURL * hostUrl = [NSURL URLWithString:@"http://map.baidu.com"];
NSArray *headeringCookie = [NSHTTPCookie cookiesWithResponseHeaderFields:@{@"Set-Cookie":@"Chdover=1"} forURL:hostUrl];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:headeringCookie
forURL:hostUrl
mainDocumentURL:nil];
NSURL * hostUrl = [NSURL URLWithString:@"http://map.baidu.com"];
NSArray *headeringCookie = [NSHTTPCookie cookiesWithResponseHeaderFields:@{@"Set-Cookie":@"Chdover=1"} forURL:hostUrl];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:headeringCookie
forURL:hostUrl
mainDocumentURL:nil];
相关文章推荐
- Xamarin.ios——First APP
- Android使用Fragment打造万能页面切换框架
- Android 四大组件BoradcastReceiver 广播
- iOS 获取键盘view 覆盖新view
- 判断Android应用是否安装、运行
- android中的适配器
- 微信第三方全网发布问题。
- Android WebView的使用
- ios获取手机型号、系统版本、设备唯一标识符、手机运营商等
- Windows-----Android--Studio-----使用Git首次提交代码
- 关于微信分享功能开发的一些bug
- Android 5.0 StatusBar全透明
- ios isa 是什么鬼???
- iOS如何自定义keyboard
- Object类概述
- iOS多线程中performSelector: 和dispatch_time的不同
- IOS 改变模态窗口大小
- 读写app.config AppSettings,保留注释与不保留注释
- Android ListView实现上拉加载更多和下拉刷新功能
- <connectionStrings> <appSettings> 读取方法