I have the following error: No declaration of “window” found in interface.
Though when I look there is one… There’s probably something stupid I missed, but can’t find it.
PlanetoidsAppDelegate.h
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface WebViewExampleAppDelegate : NSObject {
NSWindow *window;
IBOutlet WebView *webView;
}
@property (assign) IBOutlet NSWindow* window;
@property (nonatomic, retain) IBOutlet WebView* webView;
@end
PlanetoidsAppDelegate.m
#import "PlanetoidsAppDelegate.h"
@implementation PlanetoidsAppDelegate
@synthesize window; //<-- error here
@synthesize webView; //<-- error here (well, the same one for webView that is...)
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
}
- (void)awakeFromNib {
NSString *resourcesPath = [[NSBundle mainBundle] resourcePath];
NSString *htmlPath = [resourcesPath stringByAppendingString:@"/Planetoids/Planetoids_Game.html"];
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlPath]]]; //<-- error: webView undeclared, what makes sense considdering the other errors :P
}
@end
Can anyone here see the error?
Your interface is
WebViewExampleAppDelegatebut your implementation isPlanetoidsAppDelegate. These must match.