nukerebel
nukerebel

Reputation: 119

Webview object causes crash in cocoa

I'm working through "Cocoa Programming: A Quick-Start Guide for Developers." One of the examples is to create a basic browser by inserting a WebView object into a window. Whenever I do that, it causes the program to crash (compiles alright, though) with the message:

Thread 1: SIGABRT

tagged to the line:

return NSApplicationMain(argc, (const char **)argv);

I know that it is the WebView object because when I remove it, the problem goes away. I saw a similar question here that suggested adding the following lines to the preprocessor:

#import <webKit/webview.h>
#import <webKit/webkit.h>

but the result is the same. I've written no actual code, only manipulated the MainMenu.xib in the Interface Builder GUI.

Upvotes: 1

Views: 383

Answers (1)

nukerebel
nukerebel

Reputation: 119

WebKit.framework needs to be included in the build.

Go to MacHD>System>Library>Frameworks and drag the WebKit.framework folder into the project icon in XCode. A window will pop up and ask if you want to add the files to the project. Click finish and it will work.

This feels weird to not be including library files by typing in that they should be included.

Upvotes: 4

Related Questions