Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gwelmarten

macrumors 6502
Original poster
Jan 17, 2011
476
0
England!
Hi
I have been developing a web browser for Mac using the WebKit framework and WebView component in Xcode. The idea is that as soon as a user opens the app it loads a home page by default, as I do not want an address bar. Basically, I want the WebView component to OnApplicationDidLoad to navigate to a specific URL.
I'm quite new to XCode, so please don't use too advanced language in replies. I am more than happy to send copies of my project in a ZIP to specific users if they wish to view my code and see what I need to do.

Thanks so much in advance. I get so confused sometimes with XCode.

Sam
 
You need to set NSApplication's delegate to your class, and implement the method applicationDidFinishLaunching:

If that doesn't make sense to you, I suggest picking up a book/tutorial on Cocoa.
 
I understand half of that

Hi
I understand implementing into the delegate ApplicationDidLoad but I dont understand what to do for setting NS Applications Delegate in the class. As you know what you are talking about, would you kindly point me in the right direction for learnign about such things, or if it is simple, tell me how to do it?
Thanks very much in advance.
Sam
 
In your app delegates class do this:

Code:
-(void)awakeFromNib:{

[myWebView setMainFrameURL:@"http://www.google.com"];


}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.