Webkit

Discussion in 'Mac Programming' started by mack255, May 6, 2009.

Thread Status:
Not open for further replies.
  1. mack255 macrumors member

    mack255

    Joined:
    Jul 4, 2008
    #1
    Hey can anyone please tell me how i can tell webkit to load a webpage like www.macrumors.com or something like any help would be apprecaited but please dont do stuff like let me googled that for you i have googled it
     
  2. Spike099 macrumors regular

    Joined:
    Feb 18, 2007
    Location:
    Canada
    #2
    hey, pretty simple

    this following code ASSUMES "webView" is of type "WebView".
    I've linked mine as an IBOutlet.

    This is a convenience function for me, where the url is a NSString not a NSUrl. Hope it helps.
    Code:
    - (void)gotoURL:(NSString*)url {
    	[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:
    									  [NSURL URLWithString:url]]];
    }
    
     
  3. mack255 thread starter macrumors member

    mack255

    Joined:
    Jul 4, 2008
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    We don't know: you haven't shown us any code or told us what you are doing. We are not mind readers. If you mean download as in retrieve the HTML source for the page then you can just use a NSURLConnection instead.
     
  5. mack255 thread starter macrumors member

    mack255

    Joined:
    Jul 4, 2008
    #5
    I'm sorry i forgot to show the picture

    I'm sorry i forgot to show the picture
     

    Attached Files:

  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    1) WebView is a classname. Not an instance of that class. You need to send that message to a valid instance. If you don't understand what that means stop. Go a learn the basics of OOP then C then Objective-C the Cocoa

    2) urlwww.facebook.com is a meaningless token. If you are trying to define the URL as a string you need something like @"http://www.facebook.com".

    From what you've posted I suggest you need to go off and learn the basics before you try writing anything.
     
  7. mack255 thread starter macrumors member

    mack255

    Joined:
    Jul 4, 2008
    #7
    I tryed your idea

    I tryed your idea it worked but now it wont load no errors
     

    Attached Files:

  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    Treat all warnings as errors. The first warning is a fundamental error in your coding style and understanding: go away and learn the difference between a class and an instance.
     
  9. mack255 thread starter macrumors member

    mack255

    Joined:
    Jul 4, 2008
  10. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    I am perfectly calm. I am trying to help you and do you a favour. I will not bother in future as clearly you are unable to show gratitude or take advise from a professional programmer.

    My last word: learn to walk before you try to run.
     
Thread Status:
Not open for further replies.

Share This Page