I want to get uri in UIWebView where request uri
changed.in oc code
is:
- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:
(NSURLRequest *)request navigationType:
(UIWebViewNavigationType)navigationType
{
NSRange range = [request.URL.absoluteString
rangeOfString:@"code="];
if (range.location = NSNotFound)
{
returne NO;
}
return YES;
}
my question is :
wax how to write this ,
my wax code is,UIWebView work is ok,but method
webView_shouldStartLoadWithRequest don't work!
waxClass{"MyWebViewController",
UIViewController,protocols={"UIWebViewDelegate"}}
function init(self,frame)
self.webView=UIWebView:initWithFrame(frame)
self.webView.delegate =self;
self.url=NSURL:initWithString("
http://m.google.com")
local request=NSURLRequest:requestWithURL(self.url)
self.webView:loadRequest(request)
self:view():addSubview(self.webView)
return self
end
function webView_shouldStartLoadWithRequest(self,webView,request,type)
puts("in shouldStartLoadWithRequest")
return true
end