ios - AFNetworking - Store JSON results and then load them to a tableView -
I am getting JSON data from URL from Aron Networking and storing them in the SQLite database. Now, I want to display this information in a table view but the issue is that when the data is downloaded, I want to load this data from the database. Now, my view is not showing anything because the database is empty.
- Load the table view controller.
- Start UIActivityIndicatorView.
- Load the data from the JSON url and store them in the database.
- When finished, get this data from the database and place it in the table view.
- Stop
Hope you understood me.
Thank you!
According to the documentation outlined on fastening gitob pages.
FHttpRequest operation manager * Manager = [AFHTPPRKAVEST Operation Manager Manager]; [Manager GET: @ "http://example.com/resources.json" parameter: Zero breakthrough: ^ (FHttpKAEASTA Operation, Operation, ID Response Object) {NSLog (@ "Jasonn:% @", ReactionObject); } Failure: ^ (FHTPPKAESTA Operation * Operation, NSERR * error) {NSLog (@ "error:% @", error); }];
You will be involved in this success: ^ (FHttpRequest operation * operation, id response object) function, and within it you can reload your table data.
[tableoutlet reloadData];
But be sure to load your feedback data in sqlite db before reloading.
Successful function after reloading the tip in the data function.
Comments
Post a Comment