1
+ #include < CommonCrypto/CommonDigest.h>
2
+
1
3
#import " CCPackageDownload.h"
2
4
#import " CCPackageDownloadDelegate.h"
3
5
#import " CCPackage.h"
4
6
#import " CCPackageConstants.h"
5
7
#import " ccMacros.h"
6
- #include < CommonCrypto/CommonDigest.h>
7
-
8
+ #import " CCPackage_private.h"
8
9
9
10
@interface CCPackageDownload ()
10
11
@@ -68,7 +69,7 @@ - (void)pause
68
69
{
69
70
CCLOGINFO (@" [PACKAGE/DOWNLOAD][INFO] Pause" );
70
71
71
- [ _package setValue: @(CCPackageStatusDownloadPaused) forKey: @" status " ] ;
72
+ _package. status = CCPackageStatusDownloadPaused ;
72
73
73
74
[self closeConnectionAndFileHandle ];
74
75
}
@@ -109,7 +110,7 @@ - (void)createConnectionAndStartDownload
109
110
110
111
CCLOGINFO (@" [PACKAGE/DOWNLOAD][INFO] starting download of %@ " , _package);
111
112
112
- [ _package setValue: @(CCPackageStatusDownloading) forKey: @" status " ] ;
113
+ _package. status = CCPackageStatusDownloading ;
113
114
114
115
[_connection start ];
115
116
}
@@ -196,7 +197,7 @@ - (BOOL)keepDownload
196
197
CCLOGINFO (@" [PACKAGE/DOWNLOAD][INFO] Download file exists %@ " , _localURL);
197
198
[self closeConnectionAndFileHandle ];
198
199
199
- [ _package setValue: @(CCPackageStatusDownloaded) forKey: @" status " ] ;
200
+ _package. status = CCPackageStatusDownloaded ;
200
201
201
202
if ([_delegate respondsToSelector: @selector (downloadFinished: )])
202
203
{
@@ -353,7 +354,7 @@ - (void)finishDownload
353
354
354
355
[self closeConnectionAndFileHandle ];
355
356
356
- [ _package setValue: @(CCPackageStatusDownloaded) forKey: @" status " ] ;
357
+ _package. status = CCPackageStatusDownloaded ;
357
358
358
359
[_delegate downloadFinished: self ];
359
360
}
@@ -392,7 +393,7 @@ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err
392
393
393
394
[self cancel ];
394
395
395
- [ _package setValue: @(CCPackageStatusDownloadFailed) forKey: @" status " ] ;
396
+ _package. status = CCPackageStatusDownloadFailed ;
396
397
397
398
[_delegate downloadFailed: self error: error];
398
399
}
@@ -409,7 +410,7 @@ - (void)forwardResponseErrorToDelegate:(NSHTTPURLResponse *)httpResponse
409
410
@" HTTPResponse" : httpResponse
410
411
}];
411
412
412
- [ _package setValue: @(CCPackageStatusDownloadFailed) forKey: @" status " ] ;
413
+ _package. status = CCPackageStatusDownloadFailed ;
413
414
414
415
[_delegate downloadFailed: self error: error];
415
416
}
0 commit comments