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 8181023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:23:00+00:00 2026-06-07T00:23:00+00:00

i know this is a stupid question but i d’ont know how to do

  • 0

i know this is a stupid question but i d’ont know how to do that. from this link the requested link is possible to return json data with NSURLconnection ? I hope some one check this link and tell me if is this possible because i am new in this stuff.

EDIT:

i tried with NSJSONSerialization

- (void)viewDidLoad
{
    NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.goalzz.com/main.aspx?region=-1&area=6&update=true"]];
    connectionData = [[NSURLConnection alloc]initWithRequest:req delegate:self];
    [super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
 }
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
    Data = [[NSMutableData alloc] init];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    [Data appendData:data];
}

 - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSError *jsonParsingError = nil;
id object = [NSJSONSerialization JSONObjectWithData:Data options:0 error:&jsonParsingError];

if (jsonParsingError) {
    NSLog(@"JSON ERROR: %@", [jsonParsingError localizedDescription]);
} else {
    NSLog(@"OBJECT: %@", [object class]);
}
}

and I get this error message in the console :

JSON ERROR: The operation couldn’t be completed. (Cocoa error 3840.)

  • 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-06-07T00:23:03+00:00Added an answer on June 7, 2026 at 12:23 am

    As the comment above suggests, that link doesn’t return JSON. However, assuming you do have such a link, you can use the NSJSONSerialization class to parse JSON data into objective-C classes:

    http://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40010946

    Combine this with NSURLConnection and you can do what you ask. Here’s a walk through on implementing NSURLConnection:

    http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-BAJEAIEE

    And here’s an outline of what you’d need. Obviously this is not working code:

    - (void)downloadJSONFromURL {
        NSURLRequest *request = ....
        NSURLConnection *urlConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];
        // ...
    }
    
    NSMutableData *urlData;
    
    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
        urlData = [[NSMutableData alloc] init];
    }
    
    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
        [urlData appendData:data];
    }
    
    - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
        NSError *jsonParsingError = nil;
        id object = [NSJSONSerialization JSONObjectWithData:urlData options:0 error:&jsonParsingError];
    
        if (jsonParsingError) {
            DLog(@"JSON ERROR: %@", [jsonParsingError localizedDescription]);
        } else {
            DLog(@"OBJECT: %@", [object class]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this is a real stupid question, but I don't really understand
I know this is a stupid question. But just out of curiosity, is there
I know this might be a stupid question, but here it goes. I always
This may be a stupid question to ask, but still I need to know
I know this may be a stupid question to ask but I have really
I know this is a stupid question, but I've looked for 45 mins now
I know this is a stupid question, but I have been teaching myself c#,
I know this is a stupid question, but I can't find the answer anywhere.
I know this sounds like a stupid question, but I really don't see the
I know maybe this is a stupid question, But i suck at sql But

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.