Reputation: 1765
I am an ios beginner and have noticed a lot of developers using restkit, when is the corret situation to use Restkit over NSURLConnection? Since you can do get/put/post/delete using THE NSURL libraries.
Upvotes: 1
Views: 1257
Reputation: 4372
It depends on your project. If you have a tiny app that will just send data to a server probably you wouldn't need it, NSURLConnection is just fine, using Restkit for that is like killing a fly with a tank.
On the other hand if you have a project that needs to:
Send/Receive objects to your server/client and you don't want to write mappers by yourself to deal with exceptions, use Restkit.
If that data that you get from the server needs to be persisted, then use Core Data suppor from RestKit.
If you need to parse your data to JSON or other formats, Restkit can help a lot.
If you don't want to deal with handling error responses from the server, Restkit can help too, it lets you catch errors on different contexts, RK does the magic, you just show an error message :)
I think the best of all reasons is the first one, object mapping, it will save you lots of time when you learn how to use it, you can check the docs about that feature here: https://github.com/RestKit/RestKit/blob/master/Docs/Object%20Mapping.md
Upvotes: 5