Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7599505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:40:42+00:00 2026-05-30T22:40:42+00:00

UIViewController *webViewController = [[[UIViewController alloc] init] autorelease]; UIWebView *uiWebView = [[[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)]

  • 0
UIViewController *webViewController = [[[UIViewController alloc] init] autorelease];

    UIWebView *uiWebView = [[[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)] autorelease];
    NSString *urlst=[[NSString alloc]initWithString:[catWebArray objectAtIndex:indexPath.row]];
    [uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlst]]];
    uiWebView.scalesPageToFit=YES;
    [webViewController.view addSubview: uiWebView];

    [self.navigationController pushViewController:webViewController animated:YES];

where array contains adress like http://www.google.com,www.yahoo.com.
as these are added by users http:// may be added or not. so how i can load it in uiwebview?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:40:44+00:00Added an answer on May 30, 2026 at 10:40 pm

    You didn’t specify what the user interface for your application looks like, or how the user actually enters in the URL, so I am just going to assume it’s a text field that looks like what Mobile Safari uses.

    You can write a method that you call before doing your requestWithURL call, and if you don’t see a scheme pre-pended to the user’s inputted URL, you can then return one with a http:// added onto it.

    E.G.

    - (NSString *) fullyFormedURL: (NSString *) originalURL
    {
        NSRange rangeOfScheme = [originalURL rangeOfString: @"://"];
        if(rangeOfScheme.location == NSNotFound)
        {
             NSString * newURL = [NSString stringWithFormat: @"http://%@", originalURL];
        }
        return(originalURL);
    }
    

    (this snippet of code above isn’t perfect but is meant to be something to get you started… the rangeOfString call doesn’t take into consideration something fat fingered users may potentially do, like putting a scheme at the end of a string… e.g. "www.google.comhttp://")

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UIViewController *webViewController = [[[UIViewController alloc] init] autorelease]; UIWebView *uiWebView = [[[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)]
In UIViewController subclasses, I often see: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self =
UIViewController *newView = [[UIViewController alloc] initWithNibName:@NewView bundle:[NSBundle mainBundle]]; tabBarController.selectedViewController = newView; Why doesn't this
UIViewController *theController = [[HelpViewController alloc] initWithNibName:@HelpView bundle:nil]; [self.navigationController presentModalViewController:theController animated:TRUE]; Here's my code for
every UIViewController has a method called willRotateToInterface. Is it possible to do this within
I have a UIViewController that manages the display of some data. When the user
I have a UIViewController which when it loads it loads up this.. MapViewController *mapController
Summary: How should the UIViewController know the size of its UIView instance when initialising
I have subclassed UIViewController into a new class, PageViewController (I'm writing a simple book
I have a uiviewcontroller with two properties: trackName and playerObject. PlayerObject also has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.