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

  • Home
  • SEARCH
  • 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 7647581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:29:55+00:00 2026-05-31T10:29:55+00:00

I am using objective C and I am trying to load a website without

  • 0

I am using objective C and I am trying to load a website without opening it in Safari :

I am using the following function :

 NSString *website =[NSString stringWithFormat:@"http://www.website.com"];

 NSString *connected = [NSString stringWithContentsOfURL:[NSURL URLWithString:website ]encoding:NSStringEncodingConversionAllowLossy error:nil];

but when I check in my database I noticed that it does not load the website , when I load it in the browser it does detect it tho , any reasons ?

thanks

  • 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-31T10:29:56+00:00Added an answer on May 31, 2026 at 10:29 am

    You probably want to use the NSURLConnection class to retrieve data from the network. It will provide a much more useful set of errors, etc.

    For simple (but blocking), you can start off with -sendSynchronousRequest:returningResponse:error:, which retrieves a URL from the network giving you the data (in the return value), the HTTP Response, and an error.

    NSURL *url = [NSURL URLWithString: @"http://www.website.com"];
    NSURLRequest *request = [NSURLRequest requestWithURL: url];
    NSURLResponse *response;
    NSError *error;
    NSData *data = [NSURLConnection sendSynchronousRequest: request returningResponse: &response error: &error];
    

    If data isn’t nil, you’ve gotten a valid response, otherwise error contains information about the response. You still need to double-check the response in order to make sure you got what you wanted (not a “successful” response that resulted in an error due to the server sending back an error code for HTTP).

    In the future, if you need to do a POST command, you can use NSMutableURLRequest and set the type of the request.

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

Sidebar

Related Questions

I'm trying to draw the following image: Using this objective-c code: CGContextSetFillColorWithColor(ctx, [[UIColor redColor]
I'm trying to replace each textNode of the DOM tree using the following function:
I'm using objective c and trying to output a value from a function. Apparently
I am trying to pull data from a website using objective-c. This is all
I'm trying to do a simple file upload using objective c and NSUrlRequest. My
I've been trying to implement a simple component-based game object architecture using Objective-C, much
Possible Duplicate: how to make phone call by using objective c? I am trying
Im trying to create a iPhone Objective C login page using PHP/MySQL to authenticate.
I'm new to Objective C and I've been trying to do Segue using a
I'm developing an iPod-touch app, using Objective C. I am trying to capture 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.