2013-08-29 2 views
0

안녕하세요 여러분은 간단한 html NSString을 가지고 있지만 브라우저에서는 정상적으로 작동하지만 iPhone에는로드되지 않습니다. 나는 간단한 것을 사용하고있다 : [self.w loadHTMLString:errorString baseURL:nil]. 내가 뭘 놓치고 있니?간단한 html NSString에 문제가 있습니까?

NSString* errorString = [NSString stringWithFormat: 
     @"<html><body> <iframe src=\"http://64.183.101.142:81/pda.htm\"width=\"500\" height=\"500\"></iframe></body></html>"]; 
+0

HTML이 완성되지 않았습니다 ... – futureelite7

+0

@ futureelite7 뭐가 잘못 됐나요? html은 브라우저에서 잘 작동하므로 필요한 부분이 있다고 가정합니다. –

+0

나는 ur 링크가 opne 즉 "http://64.183.101.142:81/pda.htm"에 약간의 인증이 필요하다고 생각한다. –

답변

0
요 먼저 웹보기에 귀하의 요청 또는 HTML을로드하고 다음과 같은 프로토콜과 함께 UIWebViewDelegate 방법을 사용하여이 요청을 캡처 할 필요가

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 
    { 

     //capture request => request 
     //From here you have the NSURLRequest object 
    //You can extract the headers of the request to NSDictionary which will contain //the   
//authentication cookie details, token, etc. using the following method of NSURLRequest 
     //- (NSDictionary *)allHTTPHeaderFields 

    } 

소스 Source link

0

당신이 필요합니다 인증이 필요한 경우 요청 유형에 따라 문자열을 수정하십시오.

만약 얻으면 "?" 및 매개 변수에서 다음과 같이하십시오. http://xx.xx.xx.xx:81/pda.htm?user= "userX"& passwd = "something"게시 방법 인 경우 요청 본문에 데이터를 전달합니다. [NSURLRequest setHTTPBody :];

이 정보가 도움이되기를 바랍니다.

관련 문제