didFinishLoadForFrame不起作用

AHH*_*HHP 3 macos cocoa objective-c webview

我创建了一个非常简单的Mac程序来加载网页.它工作和加载它很好,但我不能运行事件!什么都没记录!

#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
Run Code Online (Sandbox Code Playgroud)

我不能使用代表权....

ifa*_*fau 10

您需要将frameLoadDelegatewebView对象的outlet设置为包含方法的类webView:didFinishLoadForFrame:

连接检查员