in AppDelegate.m in applicationDidFinishLaunching function and its says me "use of undeclared identifier 'webView' " but i set the identifier to 'webView'[[webView MainFrame] loadRequestNSURLRequest requestWithURL: [NSURL URLWithString"http://google.com"]]];
- (void)setMainFrameURL:(NSString *)URLString
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
{
IBOutlet WebView *webView;
IBOutlet NSTextField *navbar;
NSString *urlText;
}
@property (nonatomic, readonly, assign) IBOutlet NSWindow *window;
@property (nonatomic, readonly, retain)WebView *webView;
@property (nonatomic, readonly, retain)NSTextField *navbar;
@property (nonatomic, readwrite, copy)NSString *urlText;
- (IBAction)go:(id)sender;
@end
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize webView, navbar, urlText;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
urlText = [NSString stringWithFormat:@"http://www.Google.com"];
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
}
- (IBAction)go:(id)sender
{
urlText = [navbar stringValue];
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
}
@end