Using RestKit, you can use RKRequest
to load data for an image in a way like:
RKRequest* request = [RKRequest requestWithURL: url]; request.onDidLoadResponse = ^(RKResponse* response) { UIImage* image = [UIImage imageWithData: response.body];
Note that even with onDidLoadResponse
you can check response
to make sure the data type is as expected. The image download queue used above can be created as follows:
imageLoadingQueue = [RKRequestQueue requestQueueWithName: @"imageLoadingQueue"]; [imageLoadingQueue start];
source share