How do I make an UIWEBVIEW open a particular website ?

Discussion in 'iOS Programming' started by rrichar, Aug 27, 2010.

  1. rrichar macrumors newbie

    Joined:
    Aug 13, 2010
    #1
    How do I make an UIWEBVIEW open a particular website ? I am using XCODE 3.2.3 and IPHONE SDK 4.00. I have looked at several Youtube videos but I have been unable to successfully implement it in my project. I was wondering if someone here who has XCODE 3.2.3 and IPHONE SDK 4.00 can help me out. All the tutorials on youtube on this subject have been post by people who have XCODE below 3.2.3 and SDK less than 4.
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  3. rrichar thread starter macrumors newbie

    Joined:
    Aug 13, 2010
    #3
    Yes I have. I was just wondering if anyone who has XCODE 3.2.3 and IPHONE SDK 4.00 has gotten it implemented in a project. I have tried and was not sucessessful. All tutorials on the subject are not for XCODE 3.2.3 and IPHONE SDK 4.
     
  4. admanimal macrumors 68040

    Joined:
    Apr 22, 2005
    #4
    There is nothing special about using a UIWebView in XCode 3.2.3 with iOS 4 vs. older versions of XCode 3 or iOS. It is extremely simple to do what you are trying to do, but only if you understand at least the basics of iOS programming. I would recommend reading up on this topic in general rather than worrying about UIWebViews for the moment.
     
  5. newtoiphonesdk macrumors 6502a

    Joined:
    Jul 30, 2010
    #5
    I don't have the exact code with me as I'm on my iPhone but you can do this in an awakefromnib case if you wish. It has something to do with a nsurl requesturlwith string or something like that. If you google nsurl and urlwithstring I'm sure it will be near the top. Just put in an @"" with your website in the quotes and u have it

    Update
    This link has the requesturl code I mentioned in it. Just replace URL with your website in quotations after an @ sumbol
     
  6. rrichar thread starter macrumors newbie

    Joined:
    Aug 13, 2010
    #6
    got it working after watch 6 youtube tutorials.
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    viewDidLoad is probably a much more common place to do this.
     
  8. seepel macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #8
    This is better, UIWebView does some funky things if it doesn't have a superview.
     

Share This Page