I'm rather new with the whole OSX programming, I wanted to stick a WebView into an empty app. Apparently it isn't as simple as sticking a WebView on a window in interface builder and creating an outlet.
IBOutlet WebView *webView;
It gives me a
expected specifier-qualifier-list before 'WebView'
and when I don't use an outlet, it terminates due to uncaught exception. I'm not too sure what these error messages mean.
Seems it isn't that simple!
You also need to add the WebKit framework to your target and forward declare WebView or import the header file:
// header file:
@class WebView; // forward declaration sufficient in header
@interface WhatEver ... {
WebView* webview;
// ...
@property (assign) IBOutlet WebView *webview;
@end
// implementation file:
#import <WebKit/WebView.h> // if you want to do something with the WebView
@implementation WhatEver
@synthesize webview;
// ...
@end
Did you try to link the WebKit framework, then importing it?
#import "WebKit/WebKit.h"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With