2012-01-25 35 views
0

我遇到了一個問題,我的應用程序在我開始從xcode運行時會失敗。我正在嘗試構建一個具有WebView的Mac OS X應用程序。WebView OSX Xcode項目在啓動問題上加載URL

我通過AppDelegate文件將webview連接到webview。當我嘗試測試我的應用程序時,爲什麼它會一直崩潰?

這是我的錯誤: 「線程1:方案獲得SignalL 」SIGABRT「」

這是我有:

@interface WebViewExampleAppDelegate : NSObject { 
    NSWindow *window; 
    IBOutlet WebView *webView; 
} 

@property (assign) IBOutlet NSWindow *window; 
@property (nonatomic, retain) IBOutlet WebView *webView; 

@end 

@implementation WebViewExampleAppDelegate 

@synthesize window; 
@synthesize webView; 

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 
} 

- (void)awakeFromNib { 
    NSString *resourcesPath = [[NSBundle mainBundle] resourcePath]; 
    NSString *htmlPath = [resourcesPath stringByAppendingString:@"/htdocs/index.html"]; 
    [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlPath]]]; 
} 
+0

它會給你這個錯誤? – user1118321

回答

0

您可能沒有添加的WebKit框架你的項目。爲此,請轉到左側窗口的頂部(項目)部分(位於項目導航器選項卡中)和中心部分的摘要選項卡中。它說「鏈接的框架和庫,點擊底部的'+'。搜索WebKit.framework並添加它。