Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. This XML file does not appear to have any style information associated with it. The document tree is shown below.
  2. <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>
  3.  
  4. NSString *Webservice_url = self.texturl.text;
  5. NSLog(@"URL %@",Webservice_url);
  6.  
  7. // Create NSURL from string.
  8. NSURL *Final_Url = [NSURL URLWithString:Webservice_url];
  9.  
  10. // Get NSData from Final_Url
  11. NSData* data = [NSData dataWithContentsOfURL: Final_Url];
  12.  
  13. //parse out the json data
  14. NSError* error;
  15.  
  16.  
  17.  
  18.  
  19.  
  20. // Use NSJSONSerialization class method. which converts NSData to Foundation object.
  21. NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
  22. options:kNilOptions error:&error];
  23.  
  24. // Create Array
  25. NSArray* Response_array = [json objectForKey:@"Records"];
  26. NSLog(@"Array: %@", Response_array);
  27.  
  28. NSLog(@" %@",self.arr1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement