0
我有webView并发送我的cookie到我的网站使用相同的会话(网上商店)。如何获取在UIWebView中加载的页面的http://地址?
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetMaxX(self.view.frame), CGRectGetMaxY(self.view.frame))];
[webView setDelegate:self];
[self.view addSubview:webView];
NSString *sessionId = [[OCRESTAPIClient sharedClient] sessionId];
NSString *value = [@"xid=" stringByAppendingString:sessionId];
NSURL *url = [NSURL URLWithString:@"http://MySite.ru/cart"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setValue:value forHTTPHeaderField:@"Cookie"];
[webView loadRequest:request];
用户可以在我的网站上行走,我必须知道他在哪里。我怎样才能获得在webView中加载页面的网址?
[获取UIWebview的当前URL]的可能重复(http://stackoverflow.com/questions/2491410/get-current-url-of-uiwebview) –