Hello!
Im used to using xcode for applescripting programs with GUIs but then decided to use a tutorial for cocoa to write a simple web browser for my friend (applescript for 10.5 isnt very backward compatible with 10.4, there were bugs whenever he ran it which did not show up when i ran it in 10.5)
heres the snippet im stuck on. (the first part.. aaaahehehh.... :S) and i do have basic knowledge of ObjC
Using Xcode, create a document-based Cocoa application. Your new project file will already contain the needed classes and interface files to support multiple windows (namely MyDocument.h, MyDocument.m, and MyDocument.nib).
Add the Web Kit frameworks to your project.
Open MyDocument.nib using Interface Builder and drag a WebView from the CocoaGraphicsViews palette to your document window.
Create a webView outlet in MyDocument.h and read the file into Interface Builder.
Connect the webView outlet of the Files Owner to the WebView object you created in the previous step.
Add code to MyDocument.m to load a default page. You can add this code fragment to the windowControllerDidLoadNib: method:
NSString *urlText = [NSString stringWithString
"http://www.apple.com"];
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
Build and run your application.
i highlighted where im stuck in bold. i do not know how to create an outlet in xcode, i do know how to in IB tho, but it doesnt seem to want to work that way.
can somebody clear this up for me? sorry!
Im used to using xcode for applescripting programs with GUIs but then decided to use a tutorial for cocoa to write a simple web browser for my friend (applescript for 10.5 isnt very backward compatible with 10.4, there were bugs whenever he ran it which did not show up when i ran it in 10.5)
heres the snippet im stuck on. (the first part.. aaaahehehh.... :S) and i do have basic knowledge of ObjC
Using Xcode, create a document-based Cocoa application. Your new project file will already contain the needed classes and interface files to support multiple windows (namely MyDocument.h, MyDocument.m, and MyDocument.nib).
Add the Web Kit frameworks to your project.
Open MyDocument.nib using Interface Builder and drag a WebView from the CocoaGraphicsViews palette to your document window.
Create a webView outlet in MyDocument.h and read the file into Interface Builder.
Connect the webView outlet of the Files Owner to the WebView object you created in the previous step.
Add code to MyDocument.m to load a default page. You can add this code fragment to the windowControllerDidLoadNib: method:
NSString *urlText = [NSString stringWithString
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
Build and run your application.
i highlighted where im stuck in bold. i do not know how to create an outlet in xcode, i do know how to in IB tho, but it doesnt seem to want to work that way.
can somebody clear this up for me? sorry!