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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:29:53+00:00 2026-06-06T21:29:53+00:00

I have a PHP Webservice that returns a JSON string with this format: [{latitud:37.995914,longitud:-1.139705,nombre:Miguel

  • 0

I have a PHP Webservice that returns a JSON string with this format:

[{"latitud":"37.995914","longitud":"-1.139705","nombre":"Miguel de 
Unamuno"},{"latitud":"37.995433","longitud":"-1.140143","nombre":"Calle
 Pina"},{"latitud":"37.99499","longitud":"-1.140361","nombre":"Calle 
Moncayo"},{"latitud":"37.993918","longitud":"-1.139392","nombre":"Calle 
Moncayo2"},{"latitud":"37.994588","longitud":"-1.138543","nombre":"Calle 
Salvador de Madriaga"}]

In my project, I have a custom class with the next structure:

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>

@interface PCoordenada : NSObject

@property (nonatomic) CLLocationCoordinate2D *punto;
@property (nonatomic,strong) NSString *nombre;
@end

Then, I´m using other class for the main app:

#import <UIKit/UIKit.h>
#import "PCoordenada.h"

@interface TestViewController : UIViewController

@property (nonatomic,strong) NSData * HTTPResponse;
@property (nonatomic,strong) NSDictionary * dic;
@property (nonatomic,strong) NSMutableArray *arrayCoord;
@property (nonatomic,strong) PCoordenada *coor;

-(IBAction)GetDataFrom:(id)sender;

@end

I wonder how I can make a array of PCoordenada’s objects that contain the info of JSON string.

Anyone could help me?

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-06T21:29:54+00:00Added an answer on June 6, 2026 at 9:29 pm

    Do this:

    NSData *theData = [NSData dataWithContentsOfURL:[NSURL URLWithString:YOUR_URL]];
    NSArray *arrRequests = [NSJSONSerialization JSONObjectWithData:theData options:NSJSONReadingMutableContainers error:nil];
    

    which will put the JSON into an NSArray of objects. Each of these objects is an NSDictionary. So then you just need to loop through the NSArray to get out the NSDictionary of each.

    //now let's loop through the array and generate the necessary annotation views
    for (int i = 0; i<= arrRequests.count - 1; i++) {
        //now let's dig out each and every json object
        NSDictionary *dict = [arrRequests objectAtIndex:i];}
    

    Each NSDictionary that you get from the loop holds the JSON properties as a key in the NSDictionary:

     NSString *address = [NSString stringWithString:[dict objectForKey:@"Address"]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a RPC encoded PHP webservice that returns a simple soap envelope with
I have a PHP webservice that returns an XML output, and one of the
I have a web service written in PHP, that returns JSON results. It works
I have created a function in PHP that calls a webservice and parses through
I have a working PHP web service that returns data (if I input the
I have a php web service that takes the request from android/iphone app and
I have to consume a WCF WebServices but the WSDL contains bindings that PHP
I have written a webservice using the PHP SOAP classes. It has functions to
I have a web service, defined(WSDL) and implemented in PHP. This one is relatively
Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);

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.