开发者

Trouble getting webViewDidStartLoad and webViewDidFinishLoad to work

开发者 https://www.devze.com 2023-02-17 00:47 出处:网络
The web view loads the page. It doesn\'t call the webViewDidStartLoad or webViewDidFinishLoad methods.

The web view loads the page. It doesn't call the webViewDidStartLoad or webViewDidFinishLoad methods.

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:[NSURLReq开发者_如何学Pythonuest 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");
}


i think you have forgot to set your delegate. ie webView.delegate=self;

good luck

0

精彩评论

暂无评论...
验证码 换一张
取 消