Hi guys,
I have built an app that I've been working on for a little while. I basically started learning Objective-C while programming it so I have made some ***** misconception errors, mainly in the whole web service part.
Right now, I have about 10 views that all require data from a web service (an API that returns the data in jSON). The required data is slightly different from page to page. Currently, I call all the method straight from the views themselves -- this leads to a lot of code duplication, mainly in verifying if data is nil, and so on.
I know that I need to centralize the whole web service part in classes, but I'm a bit lost at how I'm supposed to do this. Where should I start? What should the structure look like?
Right now I use NSUrlConnection to make an asynchronous request. I then use NSJSONSerialization to parse my data, and I basically just store it in NSMutableArrays or an NSDictionnary.
I'm pretty sure there are some tools out there that could even do this whole management for me? Any recommendations?
I would really, really appreciate your help. Thanks a lot!