Guest User

Untitled

a guest
Jul 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. Array : {
  2. global = {
  3. players = {
  4. 1 = "John Doe, A school";
  5. 10 = "Jonathan Doe, Another school";
  6. 2 = "Joe Doe, Another school";
  7. 3 = "Jane Doe, A school";
  8. 4 = "Jay Doe, Another school";
  9. 5 = "Jimmy Doe, A school";
  10. 6 = "Jeremy Doe, Another school";
  11. 7 = "Johnny Doe, A school";
  12. 8 = "Jeremiah Doe, Another school";
  13. 9 = "Jennifer Doe, A school";
  14. };
  15. schools = {
  16. 1 = "A school";
  17. 2 = "Another school";
  18. 3 = "The school";
  19. 4 = "The other school";
  20. 5 = "That school";
  21. };
  22. text = "A dynamic text that needs to be displayed to the player.";
  23. };
  24.  
  25. for (var i in global ) {
  26. for(var j in global [i].schools ){
  27. alert(global [i].schools[j]);
  28. }
  29. }
  30.  
  31. #import "SBJson.h"
  32.  
  33. NSString *jsonString = @"{
  34. 'name': 'Simon',
  35. 'address': {'street': '1 High Street', 'town': 'Anytown'}
  36. }";
  37. NSDictionary *jsonData = [jsonString JSONValue];
  38.  
  39. NSLog(@"Simon lives in %@", [jsonData valueForKeyPath:@"address.town"]);
  40.  
  41. Simon lives in Anytown
  42.  
  43. data: {
  44. global: {
  45. players: [
  46. "John Doe, A school";
  47. "Joe Doe, Another school";
  48. "Jane Doe, A school";
  49. "Jay Doe, Another school";
  50. "Jimmy Doe, A school";
  51. "Jeremy Doe, Another school";
  52. "Johnny Doe, A school";
  53. "Jeremiah Doe, Another school";
  54. "Jennifer Doe, A school";
  55. "Jonathan Doe, Another school";
  56. ]
  57. schools: [
  58. "A school";
  59. "Another school";
  60. "The school";
  61. "The other school";
  62. "That school";
  63. ],
  64. text: "A dynamic text that needs to be displayed to the player.";
  65. }
  66. };
Add Comment
Please, Sign In to add comment