0
こんにちは皆、何か助けが必要です。私はXcode 4.0でMac用のアプリケーションを作成しようとしています。起動時にWebページを表示したいのですが、既にWebkitフレームワークを追加していますが、コードはありませんが動作しません。誰もができるだけ早くおかげでみんなをご返信ください助けることができる場合はコードがアプリケーションの開封時にWebページを起動するには
の下にアプリのdelegate.mファイル
#import "AppDelegate.h"
#import <WebKit/WebKit.h>
@implementation AppDelegate
@synthesize window = _window;
@synthesize WebView;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSString *urlAddress = @"http://www.google.com/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[[WebView mainFrame] LoadRequest:requestObj];
}
@end
とアプリのdelegate.hファイル
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet WebView *WebView;
@interface myAppDelegate : NSObject <NSApplicationDelegate> {
WebView *myWebView;
}
@property (retain, nonatomic) IBOutlet WebView *myWebView;
@end
です!
感謝の男は別の理由も、私はmywebviewプロパティでWeb表示を接続するのを忘れました。 – Blizardy