简体   繁体   中英

didFinishLoadForFrame doesn't work

I've created a very simple Mac program to load a web page. It works and loads it well but I can't run events! Nothing is logged!

#import "BenotaAppDelegate.h"
@implementation BenotaAppDelegate
@synthesize webViewIns;
@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSURL *url = [NSURL URLWithString:@"http://example.com"];
    NSURLRequest *req = [NSURLRequest requestWithURL:url];
    [[webViewIns mainFrame] loadRequest:req];
}

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {
    NSLog(@"didFinishLoadForFrame");
}
@end

I can not use delegate right....

You need to set outlet frameLoadDelegate from your webView object to a class, that contains a method webView:didFinishLoadForFrame:

连接检查器

Just a note that my (iOS) app was rejected due:

non-public API/s in your app: webView:didFinishLoadForFrame

You might want to reconsider your app, I definitely must find the 3rd party lib, which called that, and get rid of it. "It wasn't me!" is not a valid excuse :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM