티스토리 뷰
#pragma mark -
#pragma mark UIWebViewDelegate
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
//YES 면 링크 가능(처음에 불러올때도 인식하니 주의) NO면 다른페이지 안됨 ㅋㅋ
#pragma mark UIWebViewDelegate
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
//YES 면 링크 가능(처음에 불러올때도 인식하니 주의) NO면 다른페이지 안됨 ㅋㅋ
return !whenLoaded;
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
// starting the load, show the activity indicator in the status bar
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
// finished loading, hide the activity indicator in the status bar
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
// load error, hide the activity indicator in the status bar
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
// report the error inside the webview
NSString* errorString = [NSString stringWithFormat:
@"<html><center><font size=+5 color='red'>An error occurred:<br>%@</font></center></html>",
error.localizedDescription];
[self.panContentWebView loadHTMLString:errorString baseURL:nil];
}
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
// starting the load, show the activity indicator in the status bar
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
// finished loading, hide the activity indicator in the status bar
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
// load error, hide the activity indicator in the status bar
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
// report the error inside the webview
NSString* errorString = [NSString stringWithFormat:
@"<html><center><font size=+5 color='red'>An error occurred:<br>%@</font></center></html>",
error.localizedDescription];
[self.panContentWebView loadHTMLString:errorString baseURL:nil];
}
'나름 프로그래밍? > Objective-C' 카테고리의 다른 글
EUC-KR 인코딩 (2) | 2010.07.28 |
---|---|
NSSortDescriptor : Array 에 담긴 Dictionary 의 값을 이용해 소팅 (0) | 2010.06.17 |
뷰전환시 탭바 감추기 (0) | 2010.05.14 |
libxml 헤더 포함하기 (0) | 2010.05.12 |
ApplicationDelegate 참조 얻어오기 (0) | 2010.05.12 |