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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:15:33+00:00 2026-06-13T21:15:33+00:00

I used simliar code for another app of mine, it has been working fine

  • 0

I used simliar code for another app of mine, it has been working fine but when I tried it (a different IP/cgi script) for my current app, it is not working.

NSString *iQuery = [NSString stringWithFormat:@"206.196.111.206/rego/test.cgi?country=AU"];  
NSString *query = [NSString stringWithContentsOfURL:[NSURL URLWithString:iQuery] encoding:NSUTF8StringEncoding error:&errorStr];    
NSData *resultJson = [query dataUsingEncoding:NSUTF8StringEncoding];   
if(query){
   NSString *res = [[NSString alloc] initWithData:resultJson encoding:NSUTF8StringEncoding];
} else {        
   printf("Error is: %s", errorStr);
}

If I paste the query:
206.196.111.206/rego/test.cgi?country=AU
into IE or firefox, it does what it should (returns 4 digits code)

I have also tried with escaped string:

    NSString *iQuery = [NSString stringWithFormat:@"206.196.111.206/rego/test.cgi?country=AU"]; 
    NSString *escapedURL = [iQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];     
    NSString *query = [NSString stringWithContentsOfURL:[NSURL URLWithString:escapedURL] encoding:NSUTF8StringEncoding error:&errorStr];
    NSData *resultJson = [query dataUsingEncoding:NSUTF8StringEncoding];   
    if(query) {
        NSString *res = [[NSString alloc] initWithData:resultJson encoding:NSUTF8StringEncoding];    
    } else {
        printf("Error is: %s", errorStr);    
    }

if(query) returns false.

Any ideas? Thanks in advance.

  • 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-13T21:15:35+00:00Added an answer on June 13, 2026 at 9:15 pm

    Please add the protocol prefix "http://" before your request string, this solves the problem, as i am getting four digits back, otherwise the contents of error is:

    "Error the operation could not be completed."

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

Sidebar

Related Questions

I used to program for iPhone. But then I want to make another similar
I used source code of an android app that we created in the past
I'm reading some ruby code, and see 0..size and 0...size are used in similar
I found similar topics but they all used absolute positioning which placed the canvases
i have something similar to the following... used a python script to JSON to
I have seen lots of similar questions but nothing is working for me. I
I made a password generator app that works well, but I want to update
The following code is used so when clicking 'enter' when focused in an input
I used the code found here to color my buttons. I've created some methods
I used the code below to create a TableRow with content dynamically. It works

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.