我有一个 Webview,我首先在其中加载一个 URL,该 URL 将自动重定向到https://secure.authorize.net/gateway/transact.dll。
但是委托功能
两者都不
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
也不
-(NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
打电话。所以我只有一个空白页。请帮助我。
我正在使用这个函数来加载我的初始 URL
myReq=[NSURLRequest requestWithURL:[NSURL URLWithString:myStr]];
NSURLConnection *myConn=[NSURLConnection connectionWithRequest:myReq delegate:self];
if(myConn){
webdata = [[NSMutableData alloc] init];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
[webdata appendData:data];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
[[myWebView mainFrame] loadData:webdata MIMEType: @"text/html" textEncodingName: @"UTF-8" baseURL:nil];
}