A very lightweight library for processing different types of fetch response. After receiving every response request we need to process it depending on the type of the data, say text, image, xml, json etc. This is a generic library so we can add new custom processors for as many types of different types of responses we need.
You can also read local files using this handler asynchronous simple way!!
All you need to do is get started with predefined processors i.e. ‘VCResponseProcessor’ and ‘VCImageResponseProcessor’.
Usage
Add ‘VCRequestHandler.h’ to the header file, and the implementation class should follow ‘VCRequestDelegate’ protocol, add respective data processor headers to the implementation file and call following method,
VCRequest *request = [VCRequestFactory
requestWithObserver:self URL:[NSURL URLWithString:@"http://www.google.com"] cache:NSURLRequestReloadIgnoringLocalAndRemoteCacheData responseProcessor:[[[VCResponseProcessor alloc] init] autorelease]]; request.tag = 1; [[VCRequestHandler sharedHandler] requestWithRequest:request];
When removing a view or deallocating a delegate of request, Do not forget to set request delegate to nil.
You can find project source at github – https://github.com/davinc/VCRequestHandler