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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:02:47+00:00 2026-06-12T10:02:47+00:00

i am using JSONKit in my program to parse google places api but my

  • 0

i am using JSONKit in my program to parse google places api but my app crashes with the following error
-[NSURL _CFURLRequest]: unrecognized selector sent to instance

     NSString* URL = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=28.632808,77.218276&radius=500&types=atm&sensor=false&key=AIzaSyDHft2g5IDshIpXS17uOtZzkqGGgj-p1RQ"];

NSError* error = nil;
NSURLResponse* response = nil;


NSURLRequest *URLReq = [NSURL URLWithString:URL];
//[request setURL:URL];
//[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
//[request setTimeoutInterval:30];

NSData* data = [NSURLConnection sendSynchronousRequest:URLReq returningResponse:&response error:&error];

if (error)
{
    NSLog(@"Error performing request %@", URL);
    NSLog(@"%@", [error localizedDescription]);
    return;
}

NSDictionary *json = [data objectFromJSONData];

NSArray *places = [json objectForKey:@"results"];


NSLog(@"Google Data: %@", places);
  • 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-12T10:02:48+00:00Added an answer on June 12, 2026 at 10:02 am

    You’re setting up your “NSURLRequest” incorrectly and should be using requestWithURL: instead.

    Instead of

    NSURLRequest *URLReq = [NSURL URLWithString:URL];
    

    do

    NSURLRequest * urlReq = [NSURLRequest requestWithURL: [NSURL URLWithString: URL]];
    

    Also, a quick FYI: Objective C convention is to use lowercase letters for variables and ivars. Use capital letters for your class names. In other words, change “URLReq” to “urlReq” and “URL” to “url” (or even better than that, something more specific like “googlePlaceURL“).

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

Sidebar

Related Questions

I am using JSONKit to parse JSON string into NSDictionary: NSDictionary *deserializedData = [jsonString
I'm using a new API class, NSJSONSerialization, especially the following method : + (id)JSONObjectWithData:(NSData
I have a little bit of deserialisation using JSONKit. It is working, but what
I'm using JSONKit to parse a JSON string returned from my server in my
I am using JSONKit in my iOS app. It loads an extremely simple JSON
Using jQuery I'm trying to obtain the rotation state of an object but in
I'm using JSONKit with AFNetworking's AFHTTPClient (with AFJSONRequestOperation) and I can't seem to figure
I'm using JSONKit.h, JSONKit.m, ios5.1. and I tried to send data using GET method
I'm trying to use the JSONKIt found here https://github.com/johnezang/JSONKit to parse through a JSON
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly

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.