xcode web service

//  ViewController.m
//  MyWebService
//  Created by mac on 7/11/56 BE.
//  Copyright (c) 2556 Petcharaporn.p. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)callWebService:(id)sender {
NSString *urlstring = @"http://192.168.99.200/getstudent";
NSURL *url = [NSURL URLWithString:urlstring];
NSError *error;
NSString *json = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:&error];
NSLog(@"Error: %@", error);

UIAlertView *a= [[UIAlertView alloc] initWithTitle:@"Result" message:json delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

[a show];

NSData *jsondata=[json dataUsingEncoding:NSASCIIStringEncoding];

NSDictionary *jsondict=[NSJSONSerialization JSONObjectWithData:jsondata options: kNilOptions error:&error];

NSLog(@"Data: %@",jsondict);
NSLog(@"Student Name %@ %@", [jsondict objectForKey:@"firstname"],[jsondict objectForKey:@"lastname"]);
}
@end

--------------------------result--------------------------------------------------------

Screen Shot 2556-07-11 at 3.16.32 PM Screen Shot 2556-07-11 at 3.17.27 PM

Screen Shot 2556-07-11 at 3.18.04 PM