Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This XML file does not appear to have any style information associated with it. The document tree is shown below.
- <string>{"Records":[{"id":26,"date":"05/04/2014","name":"A Summary of the US Dietary Guidelines"},{"id":27,"date":"05/04/2014","name":"Accompaniments"}]}</string>
- NSString *Webservice_url = self.texturl.text;
- NSLog(@"URL %@",Webservice_url);
- // Create NSURL from string.
- NSURL *Final_Url = [NSURL URLWithString:Webservice_url];
- // Get NSData from Final_Url
- NSData* data = [NSData dataWithContentsOfURL: Final_Url];
- //parse out the json data
- NSError* error;
- // Use NSJSONSerialization class method. which converts NSData to Foundation object.
- NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
- options:kNilOptions error:&error];
- // Create Array
- NSArray* Response_array = [json objectForKey:@"Records"];
- NSLog(@"Array: %@", Response_array);
- NSLog(@" %@",self.arr1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement