Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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....

like image 785
AHHP Avatar asked Jun 05 '26 19:06

AHHP


1 Answers

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

Connections inspector

like image 132
ifau Avatar answered Jun 07 '26 12:06

ifau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!