My code is not good at all for the following reasons:
The NSURLConnection retrieves data synchronously
The decoding of JSON is not neat. A strong code smell
Synchronous network call
Next step: rewrite the below code to asynchronous mode.
In the viewDidLoad method of my ViewController, I called the following method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Decoding of JSON data
I used a lot of enumerators to walk through dictionaries and arrays at different level. It makes future changes to the JSON schema or objective-c object model difficult.