AFNetworking
is better and can handle your both problems. You can also use it for parsing as well as for image download. It can cache even and will never go to server again and again if same image is requested by an image view. Use UImageView
category provided in AFNetworking
.
Edit
Caching in Afnetworking read posts in this submisison.
If you don't want to use full functionality of AFNetworking and just want to download data, I wills suggest you don't use it, You can do this all with NSURSession
, Don't add dependency in your project. Use NSURLSession
its strong an can do better for you. YOu just need only one NSJSONSerilization
call to parse data to NSObject
, that is not to big deal.
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:
^(NSData *data, NSURLResponse *response, NSError *error) {
// ...
}];
[task resume];