Skip to content

Commit 66bd1a5

Browse files
committed
CCPackageDownload using private CCPackage header.
1 parent 405a8f2 commit 66bd1a5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cocos2d/CCPackageDownload.m

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
#include <CommonCrypto/CommonDigest.h>
2+
13
#import "CCPackageDownload.h"
24
#import "CCPackageDownloadDelegate.h"
35
#import "CCPackage.h"
46
#import "CCPackageConstants.h"
57
#import "ccMacros.h"
6-
#include <CommonCrypto/CommonDigest.h>
7-
8+
#import "CCPackage_private.h"
89

910
@interface CCPackageDownload()
1011

@@ -68,7 +69,7 @@ - (void)pause
6869
{
6970
CCLOGINFO(@"[PACKAGE/DOWNLOAD][INFO] Pause");
7071

71-
[_package setValue:@(CCPackageStatusDownloadPaused) forKey:@"status"];
72+
_package.status = CCPackageStatusDownloadPaused;
7273

7374
[self closeConnectionAndFileHandle];
7475
}
@@ -109,7 +110,7 @@ - (void)createConnectionAndStartDownload
109110

110111
CCLOGINFO(@"[PACKAGE/DOWNLOAD][INFO] starting download of %@", _package);
111112

112-
[_package setValue:@(CCPackageStatusDownloading) forKey:@"status"];
113+
_package.status = CCPackageStatusDownloading;
113114

114115
[_connection start];
115116
}
@@ -196,7 +197,7 @@ - (BOOL)keepDownload
196197
CCLOGINFO(@"[PACKAGE/DOWNLOAD][INFO] Download file exists %@", _localURL);
197198
[self closeConnectionAndFileHandle];
198199

199-
[_package setValue:@(CCPackageStatusDownloaded) forKey:@"status"];
200+
_package.status = CCPackageStatusDownloaded;
200201

201202
if ([_delegate respondsToSelector:@selector(downloadFinished:)])
202203
{
@@ -353,7 +354,7 @@ - (void)finishDownload
353354

354355
[self closeConnectionAndFileHandle];
355356

356-
[_package setValue:@(CCPackageStatusDownloaded) forKey:@"status"];
357+
_package.status = CCPackageStatusDownloaded;
357358

358359
[_delegate downloadFinished:self];
359360
}
@@ -392,7 +393,7 @@ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err
392393

393394
[self cancel];
394395

395-
[_package setValue:@(CCPackageStatusDownloadFailed) forKey:@"status"];
396+
_package.status = CCPackageStatusDownloadFailed;
396397

397398
[_delegate downloadFailed:self error:error];
398399
}
@@ -409,7 +410,7 @@ - (void)forwardResponseErrorToDelegate:(NSHTTPURLResponse *)httpResponse
409410
@"HTTPResponse" : httpResponse
410411
}];
411412

412-
[_package setValue:@(CCPackageStatusDownloadFailed) forKey:@"status"];
413+
_package.status = CCPackageStatusDownloadFailed;
413414

414415
[_delegate downloadFailed:self error:error];
415416
}

0 commit comments

Comments
 (0)