It Keeps throwing error: Receiver type webFrame for instance message is a forward declaration on the line “[[webView mainFrame ] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlStr]]];”
my .h file
@interface AttendanceWizardAppDelegate : NSObject <NSApplicationDelegate>
{
@private WebView *webView;
}
@property (weak) IBOutlet WebView *webView;
@property (assign) IBOutlet NSWindow *window;
@end
My .m file
#import "AttendanceWizardAppDelegate.h"
@implementation AttendanceWizardAppDelegate
@synthesize Username = _Username;
@synthesize Password = _Password;
@synthesize webView = _webView;
@synthesize webber = _webber;
@synthesize window = _window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSString *urlStr = @"www.google.com";
[[webView mainFrame ] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlStr]]];
}
@end
You simply need to add the import of WebKit headers in your header file:
Your code can also be simplified, by not defining a instance variable for the properties you declare:
Header file (.h):
Implementation file (.m):