I see here that many using this code but do working with me. Well. (DESKTOP APP)
Simple webview auto laucher URL
I will go to talk step by step
1) Create a project
2) Create a window and a web view
3) Put the identifier how prevelwindow (web view) and windows (window)
4) In My .H
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
WebView *prevelwindow;
}
@property (strong) IBOutlet NSWindow *window;
@property (strong) IBOutlet WebView *prevelwindow;
@end
5) In My .M
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window;
@synthesize prevelwindow;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSString *urlString = @"http://www.google.com.br";
[[prevelwindow mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
}
@end
6) Well then I compile it and it is not working.