Question regarding WebView component in Mac Web Browser

Discussion in 'Mac Programming' started by gwelmarten, Feb 15, 2011.

  1. gwelmarten macrumors 6502

    Joined:
    Jan 17, 2011
    Location:
    England!
    #1
    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
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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.
     
  3. gwelmarten thread starter macrumors 6502

    Joined:
    Jan 17, 2011
    Location:
    England!
    #3
    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
     
  4. Blakeasd macrumors 6502a

    Joined:
    Dec 29, 2009
    #4
    In your app delegates class do this:

    Code:
    
    -(void)awakeFromNib:{
    
    [myWebView setMainFrameURL:@"http://www.google.com"];
    
    
    }
    
    
    
     

Share This Page