-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathViewController.m
More file actions
executable file
·37 lines (27 loc) · 849 Bytes
/
Copy pathViewController.m
File metadata and controls
executable file
·37 lines (27 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// ViewController.m
// JSONViewExample
//
// Created by moises on 7/26/18.
// Copyright © 2018 pie33.com. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSString *pathToFile = [[NSBundle mainBundle] pathForResource:@"menu" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:pathToFile];
NSError *error = nil;
NSDictionary *parsedJSON =
[NSJSONSerialization JSONObjectWithData:data
options:0
error:&error];
[self updateWithJSONDictionary:parsedJSON];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end