Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PriapusZA

macrumors 6502a
Original poster
Oct 21, 2011
677
1
England
Hi Guys,

So I am busy following this tutorial:

http://nscookbook.com/2013/03/ios-p...ulating-a-uitableview-with-data-from-the-web/

It mentions that the industry standard for parsing JSON/XML data from the web has moved from NSURLConnection (Which I have used before, briefly ) to this AFNetworking code.

Which requires downloading and setting up a 3rd party guide.


What I want to know - is this the best way to go ahead with this sort of thing - what about compatibility in newer versions of Xcode and OS X?

For now I will use this library - but just wondering why move away from NSURLConnection to AFNetworking?
Easier to maintain code?
 
Last edited:
AFNetworking just like all other popular libraries to do the same all use NSURLConnection to do the actual 'work'. They just include a bunch of friendly methods so you can easily make requests without having to write a whole lot of boilerplate code yourself.

If you don't understand what is going on and you're learning you might well be better off writing the request and the delegate yourself. If you're making an actual app you are probably better off relying on something like AFNetworking or MKNetworkKit.

AFNetworking is there on github, have a read through the code so you can see as well what it does. That should really answer the question for you then.
 
Great, thanks for the answers.

I will read up on the library some more and go through the code myself and try to understand it.

If it makes life easier, then I will keep using it. I know for a fact I need to use this sort of thing in my app as I am pulling data from the web. (I just don't know what data, yet)

I wrote the NSURLConnection manually a few months ago - right at the start of my learning iOS development and it was a lot to type etc - I don't remember it off hand - so I will go back and look at that too, to see how it differs.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.