gpt4 book ai didi

iphone - 无法使 webViewDidStartLoad 和 webViewDidFinishLoad 正常工作

转载 作者:可可西里 更新时间:2023-11-01 03:05:38 25 4
gpt4 key购买 nike

Web View 加载页面。它不会调用 webViewDidStartLoadwebViewDidFinishLoad 方法。

N_NumberAppDelegate.h:

@interface N_NumberAppDelegate : UIViewController <UIWebViewDelegate> {
UIWindow *window;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;

@end

N_NumberAppDelegate.m:

@implementation N_NumberAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(UIApplication *)application {

UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 20, 320, 480)];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx?NNumbertxt=2N"]]];
[window addSubview:webView];
[window makeKeyAndVisible];
[window release];
}

- (void)webViewDidStartLoad:(UIWebView *)webView {
NSLog(@"Started loading");
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSLog(@"Finshed loading");
}

最佳答案

我想你忘了设置你的代表。即 webView.delegate=self;

祝你好运

关于iphone - 无法使 webViewDidStartLoad 和 webViewDidFinishLoad 正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5307487/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com