最初に URL をロードする Webview があり、これは自動的に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];
}