Created http response class and added error checking

This commit is contained in:
Diego Waxemberg
2015-01-31 01:57:23 -05:00
parent 4224d02eae
commit e3e95c29f6
10 changed files with 401 additions and 313 deletions

View File

@@ -9,6 +9,7 @@
#import "AppManager.h"
#import "CryptoManager.h"
#import "Utils.h"
#import "HttpResponse.h"
@implementation AppManager {
NSOperationQueue* _opQueue;
@@ -60,8 +61,9 @@
}
if (appImage == nil) {
HttpManager* hMan = [[HttpManager alloc] initWithHost:_host.address uniqueId:_uniqueId deviceName:deviceName cert:_cert];
NSData* appAsset = [hMan executeRequestSynchronously:[hMan newAppAssetRequestWithAppId:app.appId]];
appImage = [UIImage imageWithData:appAsset];
HttpResponse* appAssetResp = [hMan executeRequestSynchronously:[hMan newAppAssetRequestWithAppId:app.appId]];
appImage = [UIImage imageWithData:appAssetResp.responseData];
app.appImage = appImage;
if (appImage != nil) {
@synchronized(_imageCache) {