How to bring up a browser within an app?

Discussion in 'iOS Programming' started by sparetire, Aug 9, 2008.

  1. sparetire macrumors newbie

    Joined:
    Aug 9, 2008
    #1
    This must be a stupid question but I couldn't quite figure out.

    How do I bring up a browser from an iPhone app? Mind sharing some code samples?

    Is there a way to embed an url within an app (eg. like an iframe)?

    Thank you in a advance.

    -Simon
     
  2. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #2
    Look in the UIWebView documentation. You can also launch Safari with a URL.
     
  3. dgdosen macrumors 65816

    dgdosen

    Joined:
    Dec 13, 2003
    Location:
    Seattle
    #3
    Check out "The Elements" example for calling up a web page from an app. They call up wikipedia.
     
  4. sfwalter macrumors 68000

    sfwalter

    Joined:
    Jan 6, 2004
    Location:
    Dallas Texas
    #4
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mad:"http://macrumors.com"]];
     
  5. Sbrocket macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #5
    Keep in mind that this closes your application and launches Safari. This would not be the way to go about an embedded browser - WebKit through UIWebView is the way to do that.
     
  6. sparetire thread starter macrumors newbie

    Joined:
    Aug 9, 2008
    #6
    Does UIWebView work like an iframe? If I click on a link within the WebView, what will happen? Doe it terminate my app and take the user to Safari?

    Thanks.

    Simon
     

Share This Page