link a web page in application.

Discussion in 'iOS Programming' started by forrestxu, Aug 14, 2008.

  1. forrestxu macrumors newbie

    May 31, 2008
    Hi guys,

    By calling
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mad:""]];

    my application can lunch google web page. But my original application is closed.

    How can I embedded the web page into my application? Some people said we can use the code below to achieve my purpose:

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
    NSLog(@"expected:%d, got:%d", UIWebViewNavigationTypeLinkClicked, navigationType);
    if (navigationType == UIWebViewNavigationTypeLinkClicked) {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mad:""]];
    return NO;

    return YES;

    It seems we need to create webView. How to do it? I hope the google page will be inside on my application.

    I need your help. comments or sample code are welcome.

    Thank you,

  2. ace2600 macrumors member

    Mar 16, 2008
    Austin, Texas
    UICatalog sample code on the developer page has a WebView which does just that.

Share This Page