Me<_}2+>H%XKyrr5ZR8_KVe>ZqYN
z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn
zkl)9u9g=mCh&ZCJS(L4yN3k0kQ
zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr
sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u
literal 0
HcmV?d00001
diff --git a/iPhone Sample/SynchronousViewController.m b/iPhone Sample/SynchronousViewController.m
index 2c5c72ee..b7d2d6a9 100644
--- a/iPhone Sample/SynchronousViewController.m
+++ b/iPhone Sample/SynchronousViewController.m
@@ -116,7 +116,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath
if (!cell) {
cell = [DetailCell cell];
}
- NSString *key = [[[request responseHeaders] allKeys] objectAtIndex:[indexPath row]];
+ NSString *key = [[[request responseHeaders] allKeys] objectAtIndex:(NSUInteger)[indexPath row]];
[[cell textLabel] setText:key];
[[cell detailTextLabel] setText:[[request responseHeaders] objectForKey:key]];
}
@@ -127,7 +127,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath
- (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInteger)section
{
if (section == 3) {
- return [[request responseHeaders] count];
+ return (NSInteger)[[request responseHeaders] count];
} else {
return 1;
}
diff --git a/iPhone Sample/WebPageViewController.m b/iPhone Sample/WebPageViewController.m
index db982dc7..4b916026 100644
--- a/iPhone Sample/WebPageViewController.m
+++ b/iPhone Sample/WebPageViewController.m
@@ -118,9 +118,9 @@ - (void)requestFinished:(ASIWebPageRequest *)theRequest
- (void)request:(ASIHTTPRequest *)theRequest didReceiveBytes:(long long)newLength
{
- NSInteger requestNumber = [[self requestsInProgress] indexOfObject:theRequest];
+ NSUInteger requestNumber = [[self requestsInProgress] indexOfObject:theRequest];
if (requestNumber != NSNotFound) {
- RequestProgressCell *cell = (RequestProgressCell *)[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:requestNumber inSection:2]];
+ RequestProgressCell *cell = (RequestProgressCell *)[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:(NSInteger)requestNumber inSection:2]];
if ([theRequest contentLength]+[theRequest partialDownloadSize] > 0) {
float progressAmount = (float)(([theRequest totalBytesRead]*1.0)/(([theRequest contentLength]+[theRequest partialDownloadSize])*1.0));
[[cell progressView] setProgress:progressAmount];
@@ -214,7 +214,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath
if (!cell) {
cell = [RequestProgressCell cell];
}
- ASIHTTPRequest *theRequest = [[self requestsInProgress] objectAtIndex:[indexPath row]];
+ ASIHTTPRequest *theRequest = [[self requestsInProgress] objectAtIndex:(NSUInteger)[indexPath row]];
if ([theRequest didUseCachedResponse]) {
[[cell textLabel] setText:[NSString stringWithFormat:@"Cached: %@",[[theRequest url] absoluteString]]];
[[cell accessoryView] setHidden:YES];
@@ -285,7 +285,7 @@ - (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInte
if (section == 1) {
return 2;
} else if (section == 2) {
- return [requestsInProgress count];
+ return (NSInteger)[requestsInProgress count];
}
return 1;
}
diff --git a/iPhone Sample/iPhoneInfo.plist b/iPhone Sample/iPhoneInfo.plist
index e47caae1..1dbf6505 100644
--- a/iPhone Sample/iPhoneInfo.plist
+++ b/iPhone Sample/iPhoneInfo.plist
@@ -22,5 +22,18 @@
1.0
NSMainNibFile
iPhoneMainWindow
+ UILaunchImages
+
+
+ UILaunchImageMinimumOSVersion
+ 7.0
+ UILaunchImageName
+ Default
+ UILaunchImageOrientation
+ Portrait
+ UILaunchImageSize
+ {320, 568}
+
+
diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj
index 704320fe..1aa3d4b8 100644
--- a/iPhone.xcodeproj/project.pbxproj
+++ b/iPhone.xcodeproj/project.pbxproj
@@ -7,22 +7,16 @@
objects = {
/* Begin PBXBuildFile section */
- B50C1823121C26DB0055FCAB /* ClientCertificateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */; };
+ 3FAFBA88191B2C2100609F5B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */; };
+ 3FBBD316191B6DA8004729A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */; };
B50C182C121C26FA0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C182B121C26FA0055FCAB /* Security.framework */; };
B50C1848121C27510055FCAB /* client.p12 in Resources */ = {isa = PBXBuildFile; fileRef = B50C1847121C27510055FCAB /* client.p12 */; };
- B50D532C126C87ED0022EA6F /* BlocksTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B50D532B126C87ED0022EA6F /* BlocksTests.m */; };
- B50F66191297FA45003887B1 /* strict.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B50F66181297FA45003887B1 /* strict.xcconfig */; };
- B50F661A1297FA45003887B1 /* strict.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B50F66181297FA45003887B1 /* strict.xcconfig */; };
- B50F661B1297FA45003887B1 /* strict.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B50F66181297FA45003887B1 /* strict.xcconfig */; };
B51791A31024C3E800583567 /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B51791A21024C3E800583567 /* AuthenticationViewController.m */; };
- B51A1A9B11DDF85100ED75CF /* ASIDownloadCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B51A1A7A11DDF7BF00ED75CF /* ASIDownloadCacheTests.m */; };
B522DACE1030B2AB009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; };
B522DACF1030B2AB009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; };
B523254211CA01F1006C6E5A /* Sample.xib in Resources */ = {isa = PBXBuildFile; fileRef = B523254111CA01F1006C6E5A /* Sample.xib */; };
B523254311CA01F1006C6E5A /* Sample.xib in Resources */ = {isa = PBXBuildFile; fileRef = B523254111CA01F1006C6E5A /* Sample.xib */; };
B52325AD11CA05A8006C6E5A /* info.png in Resources */ = {isa = PBXBuildFile; fileRef = B52325AC11CA05A8006C6E5A /* info.png */; };
- B5254FF91025F9BF00CF7BC4 /* ProxyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5254FF71025F9BF00CF7BC4 /* ProxyTests.m */; };
- B52D4A2F10DA4ED5008E8365 /* PerformanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B52D4A2E10DA4ED5008E8365 /* PerformanceTests.m */; };
B53E6D951257B45800C1E79A /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E6D911257B45800C1E79A /* ASIDataDecompressor.m */; };
B53E6D961257B45800C1E79A /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E6D931257B45800C1E79A /* ASIDataCompressor.m */; };
B53E6D971257B45800C1E79A /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E6D911257B45800C1E79A /* ASIDataDecompressor.m */; };
@@ -49,9 +43,6 @@
B55B60CF0F765BBA0064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60460F765A320064029C /* ASIFormDataRequest.m */; };
B55B60D00F765BBD0064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60480F765A320064029C /* ASIHTTPRequest.m */; };
B55B60D10F765BC00064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604A0F765A320064029C /* ASINetworkQueue.m */; };
- B55B60D30F765BC90064029C /* ASIFormDataRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60530F765A3C0064029C /* ASIFormDataRequestTests.m */; };
- B55B60D40F765BCD0064029C /* ASIHTTPRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60550F765A3C0064029C /* ASIHTTPRequestTests.m */; };
- B55B60D50F765BD00064029C /* ASINetworkQueueTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60570F765A3C0064029C /* ASINetworkQueueTests.m */; };
B5652920101C8BD7000499CF /* ASITestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = B565291F101C8BD7000499CF /* ASITestCase.m */; };
B56529A3101C8EDA000499CF /* iphone-tests-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B56529A2101C8EDA000499CF /* iphone-tests-icon.png */; };
B576D4C111C7CC970059B815 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C011C7CC970059B815 /* CFNetwork.framework */; };
@@ -91,7 +82,6 @@
B5873FDD10FF28CA001E145F /* ASICloudFilesObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD110FF28CA001E145F /* ASICloudFilesObject.m */; };
B5873FDE10FF28CA001E145F /* ASICloudFilesObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD310FF28CA001E145F /* ASICloudFilesObjectRequest.m */; };
B5873FDF10FF28CA001E145F /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD510FF28CA001E145F /* ASICloudFilesRequest.m */; };
- B5873FF510FF2904001E145F /* ASICloudFilesRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FF310FF2904001E145F /* ASICloudFilesRequestTests.m */; };
B59A87C2103EC6F200300252 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = B59A87C1103EC6F200300252 /* ASIAuthenticationDialog.m */; };
B59A87C3103EC6F200300252 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = B59A87C1103EC6F200300252 /* ASIAuthenticationDialog.m */; };
B5BD2AFA11CA541100D7C426 /* iPadSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BD2AF911CA541100D7C426 /* iPadSampleAppDelegate.m */; };
@@ -105,8 +95,6 @@
B5BD2B0C11CA542700D7C426 /* SampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BD2B0A11CA542700D7C426 /* SampleViewController.m */; };
B5BD2B0E11CA542700D7C426 /* SampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BD2B0A11CA542700D7C426 /* SampleViewController.m */; };
B5BF64EF12FDFC7100CBC324 /* GHUnitIOSTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BF64EE12FDFC7100CBC324 /* GHUnitIOSTestMain.m */; };
- B5C6663E100A82D7004F3C96 /* ASIS3RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5C6663D100A82D7004F3C96 /* ASIS3RequestTests.m */; };
- B5EA45AA109B56D800E920CB /* StressTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5EA45A9109B56D800E920CB /* StressTests.m */; };
B5FE752711DBBA6400F898C8 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B5FE752511DBBA6400F898C8 /* ASIDownloadCache.m */; };
B5FE752811DBBA6400F898C8 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B5FE752511DBBA6400F898C8 /* ASIDownloadCache.m */; };
B5FE752911DBBA6400F898C8 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B5FE752511DBBA6400F898C8 /* ASIDownloadCache.m */; };
@@ -143,6 +131,7 @@
/* Begin PBXFileReference section */
1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASIHTTPRequest iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "iPhone Sample/Resources/Default-568h@2x.png"; sourceTree = ""; };
B50C1821121C26DB0055FCAB /* ClientCertificateTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientCertificateTests.h; sourceTree = ""; };
B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientCertificateTests.m; sourceTree = ""; };
B50C182B121C26FA0055FCAB /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
@@ -405,6 +394,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
+ 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */,
B52325AC11CA05A8006C6E5A /* info.png */,
B558B58911C7F637009B4627 /* iPhoneInfo.plist */,
B558B58B11C7F63E009B4627 /* iPadInfo.plist */,
@@ -616,7 +606,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0410;
+ LastUpgradeCheck = 0510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iPhone" */;
compatibilityVersion = "Xcode 3.2";
@@ -645,9 +635,9 @@
buildActionMask = 2147483647;
files = (
B55B60740F765A990064029C /* iphone-icon.png in Resources */,
+ 3FAFBA88191B2C2100609F5B /* Default-568h@2x.png in Resources */,
B576D76611C7F4D90059B815 /* iPhoneMainWindow.xib in Resources */,
B523254311CA01F1006C6E5A /* Sample.xib in Resources */,
- B50F661A1297FA45003887B1 /* strict.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -657,7 +647,7 @@
files = (
B56529A3101C8EDA000499CF /* iphone-tests-icon.png in Resources */,
B50C1848121C27510055FCAB /* client.p12 in Resources */,
- B50F661B1297FA45003887B1 /* strict.xcconfig in Resources */,
+ 3FBBD316191B6DA8004729A0 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -669,7 +659,6 @@
B558B5EB11C7F9C8009B4627 /* iPadMainWindow.xib in Resources */,
B523254211CA01F1006C6E5A /* Sample.xib in Resources */,
B52325AD11CA05A8006C6E5A /* info.png in Resources */,
- B50F66191297FA45003887B1 /* strict.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -754,16 +743,9 @@
B55B60CF0F765BBA0064029C /* ASIFormDataRequest.m in Sources */,
B55B60D00F765BBD0064029C /* ASIHTTPRequest.m in Sources */,
B55B60D10F765BC00064029C /* ASINetworkQueue.m in Sources */,
- B55B60D30F765BC90064029C /* ASIFormDataRequestTests.m in Sources */,
- B55B60D40F765BCD0064029C /* ASIHTTPRequestTests.m in Sources */,
- B55B60D50F765BD00064029C /* ASINetworkQueueTests.m in Sources */,
- B5C6663E100A82D7004F3C96 /* ASIS3RequestTests.m in Sources */,
B5652920101C8BD7000499CF /* ASITestCase.m in Sources */,
- B5254FF91025F9BF00CF7BC4 /* ProxyTests.m in Sources */,
B522DACE1030B2AB009A2D22 /* ASIInputStream.m in Sources */,
B59A87C2103EC6F200300252 /* ASIAuthenticationDialog.m in Sources */,
- B5EA45AA109B56D800E920CB /* StressTests.m in Sources */,
- B52D4A2F10DA4ED5008E8365 /* PerformanceTests.m in Sources */,
B5873FD610FF28CA001E145F /* ASIS3BucketObject.m in Sources */,
B5873FD810FF28CA001E145F /* ASIS3Request.m in Sources */,
B5873FD910FF28CA001E145F /* ASICloudFilesCDNRequest.m in Sources */,
@@ -773,18 +755,14 @@
B5873FDD10FF28CA001E145F /* ASICloudFilesObject.m in Sources */,
B5873FDE10FF28CA001E145F /* ASICloudFilesObjectRequest.m in Sources */,
B5873FDF10FF28CA001E145F /* ASICloudFilesRequest.m in Sources */,
- B5873FF510FF2904001E145F /* ASICloudFilesRequestTests.m in Sources */,
B540400B115114BA00D8BE63 /* ASIS3Bucket.m in Sources */,
B540400C115114BA00D8BE63 /* ASIS3BucketRequest.m in Sources */,
B540400D115114BA00D8BE63 /* ASIS3ObjectRequest.m in Sources */,
B540400E115114BA00D8BE63 /* ASIS3ServiceRequest.m in Sources */,
B55252B411D22E2200F9B170 /* Reachability.m in Sources */,
B5FE752711DBBA6400F898C8 /* ASIDownloadCache.m in Sources */,
- B51A1A9B11DDF85100ED75CF /* ASIDownloadCacheTests.m in Sources */,
- B50C1823121C26DB0055FCAB /* ClientCertificateTests.m in Sources */,
B53E6D951257B45800C1E79A /* ASIDataDecompressor.m in Sources */,
B53E6D961257B45800C1E79A /* ASIDataCompressor.m in Sources */,
- B50D532C126C87ED0022EA6F /* BlocksTests.m in Sources */,
B57D0F4A12AA7D3600E5F992 /* ASIWebPageRequest.m in Sources */,
B5BF64EF12FDFC7100CBC324 /* GHUnitIOSTestMain.m in Sources */,
);
@@ -936,14 +914,13 @@
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch";
- GCC_VERSION = com.apple.compilers.llvmgcc42;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2";
INFOPLIST_FILE = "iPhone Sample/iPadInfo.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
@@ -957,11 +934,10 @@
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch";
- GCC_VERSION = com.apple.compilers.llvmgcc42;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2";
INFOPLIST_FILE = "iPhone Sample/iPadInfo.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
@@ -973,7 +949,6 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -986,7 +961,6 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
diff --git a/strict.xcconfig.bak b/strict.xcconfig.bak
new file mode 100644
index 00000000..018f7776
--- /dev/null
+++ b/strict.xcconfig.bak
@@ -0,0 +1,26 @@
+//
+// strict.xcconfig
+// Mac
+//
+// Created by Ben Copsey on 25/11/2009.
+// Copyright 2009 All-Seeing Interactive. All rights reserved.
+//
+
+GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
+GCC_WARN_SHADOW = YES
+GCC_WARN_64_TO_32_BIT_CONVERSION = YES
+GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
+GCC_WARN_ABOUT_RETURN_TYPE = YES
+//GCC_WARN_MISSING_PARENTHESES = YES
+GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
+//GCC_WARN_ABOUT_MISSING_NEWLINE = YES
+GCC_WARN_SIGN_COMPARE = YES
+GCC_WARN_STRICT_SELECTOR_MATCH = missing value
+GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
+GCC_WARN_UNDECLARED_SELECTOR = YES
+GCC_WARN_UNUSED_FUNCTION = YES
+GCC_WARN_UNUSED_LABEL = YES
+GCC_WARN_UNUSED_VALUE = YES
+GCC_WARN_UNUSED_VARIABLE = YES
+GCC_TREAT_WARNINGS_AS_ERRORS = YES
+//RUN_CLANG_STATIC_ANALYZER = YES
\ No newline at end of file
From 91caf439fcab94c917f92b46f313bcbbf9d9b281 Mon Sep 17 00:00:00 2001
From: Bruce Chen <662005@qq.com>
Date: Thu, 8 May 2014 18:21:20 +0800
Subject: [PATCH 05/37] Set s3HOST to "sinastorage.com" on ASIS3Request and
sign
---
Classes/ASIHTTPRequest.m | 2 +-
Classes/S3/ASIS3Request.m | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m
index 4d2455f5..30a98921 100644
--- a/Classes/ASIHTTPRequest.m
+++ b/Classes/ASIHTTPRequest.m
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
-NSString *ASIHTTPRequestVersion = @"v1.8.2-9 2014-05-08";
+NSString *ASIHTTPRequestVersion = @"v1.8.2-10 2014-05-08";
static NSString *defaultUserAgent = nil;
diff --git a/Classes/S3/ASIS3Request.m b/Classes/S3/ASIS3Request.m
index d07000c9..11c3d067 100644
--- a/Classes/S3/ASIS3Request.m
+++ b/Classes/S3/ASIS3Request.m
@@ -125,8 +125,8 @@ - (void)buildRequestHeaders
// Jump through hoops while eating hot food
NSString *stringToSign = [self stringToSignForHeaders:canonicalizedAmzHeaders resource:canonicalizedResource];
- NSString *signature = [ASIHTTPRequest base64forData:[ASIS3Request HMACSHA1withKey:[self secretAccessKey] forString:stringToSign]];
- NSString *authorizationString = [NSString stringWithFormat:@"AWS %@:%@",[self accessKey],signature];
+ NSString *signature = [[ASIHTTPRequest base64forData:[ASIS3Request HMACSHA1withKey:[self secretAccessKey] forString:stringToSign]] substringWithRange:NSMakeRange(5, 10)];
+ NSString *authorizationString = [NSString stringWithFormat:@"SINA %@:%@",[self accessKey],signature];
[self addRequestHeader:@"Authorization" value:authorizationString];
@@ -295,7 +295,8 @@ + (NSData *)HMACSHA1withKey:(NSString *)key forString:(NSString *)string
+ (NSString *)S3Host
{
- return @"s3.amazonaws.com";
+ return @"sinastorage.com";
+ //return @"s3.amazonaws.com";
}
- (void)buildURL
From 1b593ca80714fed5693c2cbcb3531ece3d61d8ad Mon Sep 17 00:00:00 2001
From: Bruce Chen <662005@qq.com>
Date: Fri, 9 May 2014 18:16:22 +0800
Subject: [PATCH 06/37] update
---
Classes/ASIHTTPRequest.m | 4 +-
Classes/S3/ASIS3Request.h | 1 +
Classes/S3/ASIS3Request.m | 34 +-
Classes/S3/ASIS3ServiceRequest.m | 39 +-
Classes/Tests/ASISCSRequestTests.h | 18 +
Classes/Tests/ASISCSRequestTests.m | 807 +++++++++++++++++++++++++++++
Classes/Tests/ASITestCase.h | 2 +-
Mac.xcodeproj/project.pbxproj | 42 +-
8 files changed, 933 insertions(+), 14 deletions(-)
create mode 100644 Classes/Tests/ASISCSRequestTests.h
create mode 100644 Classes/Tests/ASISCSRequestTests.m
diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m
index 30a98921..6d2fb47c 100644
--- a/Classes/ASIHTTPRequest.m
+++ b/Classes/ASIHTTPRequest.m
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
-NSString *ASIHTTPRequestVersion = @"v1.8.2-10 2014-05-08";
+NSString *ASIHTTPRequestVersion = @"v1.8.2-11 2014-05-09";
static NSString *defaultUserAgent = nil;
@@ -4560,7 +4560,7 @@ + (void)recordBandwidthUsage
}
}
#if DEBUG_THROTTLING
- ASI_DEBUG_LOG(@"[THROTTLING] ===Used: %u bytes of bandwidth in last measurement period===",bandwidthUsedInLastSecond);
+ ASI_DEBUG_LOG(@"[THROTTLING] ===Used: %lu bytes of bandwidth in last measurement period===",bandwidthUsedInLastSecond);
#endif
[bandwidthUsageTracker addObject:[NSNumber numberWithUnsignedLong:bandwidthUsedInLastSecond]];
[bandwidthMeasurementDate release];
diff --git a/Classes/S3/ASIS3Request.h b/Classes/S3/ASIS3Request.h
index 913aef9d..7759ba83 100644
--- a/Classes/S3/ASIS3Request.h
+++ b/Classes/S3/ASIS3Request.h
@@ -71,6 +71,7 @@ typedef enum _ASIS3ErrorType {
// Parses the response to work out if S3 returned an error
- (void)parseResponseXML;
+- (void)parseResponseJson;
#pragma mark shared access keys
diff --git a/Classes/S3/ASIS3Request.m b/Classes/S3/ASIS3Request.m
index 11c3d067..5585373e 100644
--- a/Classes/S3/ASIS3Request.m
+++ b/Classes/S3/ASIS3Request.m
@@ -35,6 +35,7 @@ - (id)initWithURL:(NSURL *)newURL
// After a bit of experimentation/guesswork, this number seems to reduce the chance of a 'RequestTimeout' error
[self setPersistentConnectionTimeoutSeconds:20];
[self setRequestScheme:ASIS3RequestSchemeHTTP];
+ [self setValidatesSecureCertificate:NO];
return self;
}
@@ -135,14 +136,43 @@ - (void)buildRequestHeaders
- (void)requestFinished
{
if ([[[self responseHeaders] objectForKey:@"Content-Type"] isEqualToString:@"application/xml"]) {
+
[self parseResponseXML];
- }
+
+ } else if ([[[self responseHeaders] objectForKey:@"Content-Type"] isEqualToString:@"application/json"]) {
+
+ [self parseResponseJson];
+ }
if (![self error]) {
[super requestFinished];
}
}
-#pragma mark Error XML parsing
+#pragma mark Error XML/Json parsing
+
+- (void)parseResponseJson {
+
+ /*
+
+ {"Message": "The provided token has expired.()", "Code": "ExpiredToken", "Resource": "\/", "RequestId": "05b43801-1405-0916-1056-782bcb67e2e3"}
+
+ */
+
+ NSError *jsonParseError = nil;
+ NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:[self responseData] options:kNilOptions error:&jsonParseError];
+
+ if (jsonParseError == nil && jsonObject && [jsonObject isKindOfClass:[NSDictionary class]]) {
+
+ if ([jsonObject objectForKey:@"Message"]) {
+
+ [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIS3ResponseErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[jsonObject objectForKey:@"Message"], NSLocalizedDescriptionKey, nil]]];
+ }
+
+ } else {
+
+ [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIS3ResponseParsingFailedType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Parsing the resposnse failed", NSLocalizedDescriptionKey, jsonParseError, NSUnderlyingErrorKey, nil]]];
+ }
+}
- (void)parseResponseXML
{
diff --git a/Classes/S3/ASIS3ServiceRequest.m b/Classes/S3/ASIS3ServiceRequest.m
index 40e897aa..b261b771 100644
--- a/Classes/S3/ASIS3ServiceRequest.m
+++ b/Classes/S3/ASIS3ServiceRequest.m
@@ -43,7 +43,42 @@ - (void)dealloc
- (void)buildURL
{
- [self setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://%@",[self requestScheme],[[self class] S3Host]]]];
+ [self setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://%@/?formatter=json",[self requestScheme],[[self class] S3Host]]]];
+}
+
+- (void)parseResponseJson {
+
+ NSError *jsonParseError = nil;
+ NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:[self responseData] options:kNilOptions error:&jsonParseError];
+
+ if (jsonParseError == nil && jsonObject && [jsonObject isKindOfClass:[NSDictionary class]] && [jsonObject objectForKey:@"Owner"] && [jsonObject objectForKey:@"Buckets"]) {
+
+ if ([[jsonObject objectForKey:@"Owner"] isKindOfClass:[NSDictionary class]]) {
+
+ NSDictionary *owner = [jsonObject objectForKey:@"Owner"];
+
+ [self setOwnerID:[owner objectForKey:@"ID"]];
+ [self setOwnerName:[owner objectForKey:@"DisplayName"]];
+ }
+
+ if ([[jsonObject objectForKey:@"Buckets"] isKindOfClass:[NSArray class]]) {
+
+ for (id item in [jsonObject objectForKey:@"Buckets"]) {
+
+ if ([item isKindOfClass:[NSDictionary class]]) {
+
+ ASIS3Bucket *bucket = [ASIS3Bucket bucketWithOwnerID:[self ownerID] ownerName:[self ownerName]];
+ [bucket setName:[item objectForKey:@"Name"]];
+ [bucket setCreationDate:[[ASIS3Request S3RequestDateFormatter] dateFromString:[item objectForKey:@"CreationDate"]]];
+ [[self buckets] addObject:bucket];
+ }
+ }
+ }
+
+ } else {
+
+ [super parseResponseJson];
+ }
}
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
@@ -62,7 +97,7 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
} else if ([elementName isEqualToString:@"Name"]) {
[[self currentBucket] setName:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"CreationDate"]) {
- [[self currentBucket] setCreationDate:[[ASIS3Request S3ResponseDateFormatter] dateFromString:[self currentXMLElementContent]]];
+ [[self currentBucket] setCreationDate:[[ASIS3Request S3RequestDateFormatter] dateFromString:[self currentXMLElementContent]]];
} else if ([elementName isEqualToString:@"ID"]) {
[self setOwnerID:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"DisplayName"]) {
diff --git a/Classes/Tests/ASISCSRequestTests.h b/Classes/Tests/ASISCSRequestTests.h
new file mode 100644
index 00000000..3117443b
--- /dev/null
+++ b/Classes/Tests/ASISCSRequestTests.h
@@ -0,0 +1,18 @@
+//
+// ASIS3RequestTests.h
+// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
+//
+// Created by Ben Copsey on 12/07/2009.
+// Copyright 2009 All-Seeing Interactive. All rights reserved.
+//
+
+#import "ASITestCase.h"
+
+@class ASINetworkQueue;
+
+@interface ASISCSRequestTests : ASITestCase {
+
+
+}
+
+@end
diff --git a/Classes/Tests/ASISCSRequestTests.m b/Classes/Tests/ASISCSRequestTests.m
new file mode 100644
index 00000000..a005ebdc
--- /dev/null
+++ b/Classes/Tests/ASISCSRequestTests.m
@@ -0,0 +1,807 @@
+//
+// ASIS3RequestTests.m
+// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
+//
+// Created by Ben Copsey on 12/07/2009.
+// Copyright 2009 All-Seeing Interactive. All rights reserved.
+//
+
+#import "ASISCSRequestTests.h"
+#import "ASINetworkQueue.h"
+#import "ASIS3BucketObject.h"
+#import "ASIS3ObjectRequest.h"
+#import "ASIS3BucketRequest.h"
+#import "ASIS3ServiceRequest.h"
+
+// Fill in these to run the tests that actually connect and manipulate objects on S3
+static NSString *accessKey = @"";
+static NSString *secretAccessKey = @"";
+
+// You should run these tests on a bucket that does not yet exist
+static NSString *bucket = @"";
+
+
+
+// Stop clang complaining about undeclared selectors
+@interface ASISCSRequestTests () {
+
+ ASINetworkQueue *networkQueue;
+ float progress;
+}
+
+- (void)GETRequestDone:(ASIHTTPRequest *)request;
+- (void)GETRequestFailed:(ASIHTTPRequest *)request;
+- (void)PUTRequestDone:(ASIHTTPRequest *)request;
+- (void)PUTRequestFailed:(ASIHTTPRequest *)request;
+- (void)DELETERequestDone:(ASIHTTPRequest *)request;
+- (void)DELETERequestFailed:(ASIHTTPRequest *)request;
+
+@property (retain, nonatomic) ASINetworkQueue *networkQueue;
+
+@end
+
+@implementation ASISCSRequestTests
+
+- (void)logRequest:(ASIHTTPRequest *)request {
+
+ GHTestLog(@"Request =============================\n");
+ GHTestLog(@"%@: %@", [request requestMethod], [request url]);
+ GHTestLog(@"%@", [request requestHeaders]);
+
+ GHTestLog(@"\n\nResponse =============================\n");
+ GHTestLog(@"%d: %@", [request responseStatusCode], [request responseStatusMessage]);
+ GHTestLog(@"%@", [request responseHeaders]);
+ GHTestLog(@"%@", [request responseString]);
+}
+
+
+- (NSString *)randomStringWithLength:(int)len {
+
+ NSString *letters = @"abcdefghijklmnopqrstuvwxyz0123456789";
+
+ NSMutableString *randomString = [NSMutableString stringWithCapacity:len];
+
+ for (int i=0; i 0);
+ GHAssertTrue(success,@"Failed to create a retained copy");
+ success = ([request2 isKindOfClass:[ASIS3Request class]]);
+ GHAssertTrue(success,@"Copy is of wrong class");
+
+ [request2 release];
+
+ pool = [[NSAutoreleasePool alloc] init];
+
+
+ ASIS3BucketRequest *request3 = [ASIS3BucketRequest requestWithBucket:@"foo"];
+ ASIS3BucketRequest *request4 = [request3 copy];
+ GHAssertNotNil(request4,@"Failed to create a copy");
+
+ [pool release];
+
+ success = ([request4 retainCount] > 0);
+ GHAssertTrue(success,@"Failed to create a retained copy");
+ success = ([request4 isKindOfClass:[ASIS3BucketRequest class]]);
+ GHAssertTrue(success,@"Copy is of wrong class");
+
+ [request4 release];
+
+ pool = [[NSAutoreleasePool alloc] init];
+
+
+ ASIS3BucketObject *bucketObject = [ASIS3BucketObject objectWithBucket:@"foo"];
+ ASIS3BucketObject *bucketObject2 = [bucketObject copy];
+ GHAssertNotNil(bucketObject2,@"Failed to create a copy");
+
+ [pool release];
+
+ success = ([bucketObject2 retainCount] > 0);
+ GHAssertTrue(success,@"Failed to create a retained copy");
+
+ [bucketObject2 release];
+}
+
+
+- (void)testHTTPS
+{
+ [ASIS3Request setSharedAccessKey:accessKey];
+ [ASIS3Request setSharedSecretAccessKey:secretAccessKey];
+
+ // Create a bucket
+ ASIS3Request *request = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
+ [request setValidatesSecureCertificate:NO];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ GHAssertNil([request error],@"Failed to create a bucket");
+
+ // PUT something in it
+ NSString *key = @"king";
+ request = [ASIS3ObjectRequest PUTRequestForData:[@"fink" dataUsingEncoding:NSUTF8StringEncoding] withBucket:bucket key:key];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ BOOL success = [[request responseString] isEqualToString:@""];
+ GHAssertTrue(success,@"Failed to PUT some data into S3");
+
+ // GET it
+ request = [ASIS3ObjectRequest requestWithBucket:bucket key:key];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ success = [[request responseString] isEqualToString:@"fink"];
+ GHAssertTrue(success,@"Failed to GET the correct data from S3");
+
+ // DELETE it
+ request = [ASIS3ObjectRequest DELETERequestWithBucket:bucket key:@"king"];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ success = [[request responseString] isEqualToString:@""];
+ GHAssertTrue(success,@"Failed to DELETE the object from S3");
+
+ // Delete the bucket
+ request = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ GHAssertNil([request error],@"Failed to delete a bucket");
+
+ [ASIS3Request setSharedAccessKey:nil];
+ [ASIS3Request setSharedSecretAccessKey:nil];
+}
+
+// Ideally this test would actually parse the ACL XML and check it, but for now it just makes sure S3 doesn't return an error
+- (void)testCannedACLs
+{
+ [ASIS3Request setSharedAccessKey:accessKey];
+ [ASIS3Request setSharedSecretAccessKey:secretAccessKey];
+
+ // Create a bucket
+ ASIS3Request *request = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ GHAssertNil([request error],@"Failed to create a bucket");
+
+ NSArray *ACLs = [NSArray arrayWithObjects:ASIS3AccessPolicyPrivate, ASIS3AccessPolicyPublicRead, ASIS3AccessPolicyPublicReadWrite, ASIS3AccessPolicyAuthenticatedRead, nil];
+
+ for (NSString *cannedACL in ACLs) {
+ // PUT object
+ NSString *key = @"king";
+ request = [ASIS3ObjectRequest PUTRequestForData:[@"fink" dataUsingEncoding:NSUTF8StringEncoding] withBucket:bucket key:key];
+ [request setAccessPolicy:cannedACL];
+ [request startSynchronous];
+ [self logRequest:request];
+ GHAssertNil([request error],@"Failed to PUT some data into S3");
+
+ sleep(1);
+
+ // GET object ACL
+ request = [ASIS3ObjectRequest requestWithBucket:bucket key:key subResource:@"acl"];
+ [request startSynchronous];
+ [self logRequest:request];
+ GHAssertNil([request error],@"Failed to fetch the object");
+ }
+
+ // DELETE it
+ request = [ASIS3ObjectRequest DELETERequestWithBucket:bucket key:@"king"];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ BOOL success = [[request responseString] isEqualToString:@""];
+ GHAssertTrue(success,@"Failed to DELETE the object from S3");
+
+ // Delete the bucket
+ request = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
+ [request setRequestScheme:ASIS3RequestSchemeHTTPS];
+ [request startSynchronous];
+ GHAssertNil([request error],@"Failed to delete a bucket");
+
+ [ASIS3Request setSharedAccessKey:nil];
+ [ASIS3Request setSharedSecretAccessKey:nil];
+}
+
+
+@synthesize networkQueue;
+
+@end
diff --git a/Classes/Tests/ASITestCase.h b/Classes/Tests/ASITestCase.h
index 2d33540e..2dae15a0 100644
--- a/Classes/Tests/ASITestCase.h
+++ b/Classes/Tests/ASITestCase.h
@@ -14,7 +14,7 @@
#import
#endif
-@interface ASITestCase : GHTestCase {
+@interface ASITestCase : GHAsyncTestCase {
}
- (NSString *)filePathForTemporaryTestFiles;
@end
diff --git a/Mac.xcodeproj/project.pbxproj b/Mac.xcodeproj/project.pbxproj
index 4f9759cf..f74cabb2 100644
--- a/Mac.xcodeproj/project.pbxproj
+++ b/Mac.xcodeproj/project.pbxproj
@@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
- 3F4BF1D6191B86610047A6E7 /* ASIS3RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5C664BB100A6220004F3C96 /* ASIS3RequestTests.m */; };
+ 3F4BF1DC191CB5A60047A6E7 /* ASISCSRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F4BF1DB191CB5A60047A6E7 /* ASISCSRequestTests.m */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
B50C17DB121C254D0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C17DA121C254D0055FCAB /* Security.framework */; };
B522D71F103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
@@ -73,6 +73,8 @@
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; };
+ 3F4BF1DA191CB5A60047A6E7 /* ASISCSRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASISCSRequestTests.h; sourceTree = ""; };
+ 3F4BF1DB191CB5A60047A6E7 /* ASISCSRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASISCSRequestTests.m; sourceTree = ""; };
8D1107320486CEB800E47090 /* Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mac.app; sourceTree = BUILT_PRODUCTS_DIR; };
B50244191025D36B002B13E1 /* ProxyTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyTests.h; sourceTree = ""; };
B502441A1025D36B002B13E1 /* ProxyTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyTests.m; sourceTree = ""; };
@@ -275,22 +277,47 @@
name = Frameworks;
sourceTree = "";
};
- B51E61A2100BA84C004A300D /* S3 */ = {
+ 3F4BF1D7191C76B80047A6E7 /* Requests */ = {
isa = PBXGroup;
children = (
- B5403FE61151149E00D8BE63 /* ASIS3Bucket.h */,
- B5403FE71151149E00D8BE63 /* ASIS3Bucket.m */,
B5403FE81151149E00D8BE63 /* ASIS3BucketRequest.h */,
B5403FE91151149E00D8BE63 /* ASIS3BucketRequest.m */,
B5403FEA1151149E00D8BE63 /* ASIS3ObjectRequest.h */,
B5403FEB1151149E00D8BE63 /* ASIS3ObjectRequest.m */,
B5403FEC1151149E00D8BE63 /* ASIS3ServiceRequest.h */,
B5403FED1151149E00D8BE63 /* ASIS3ServiceRequest.m */,
- B5873F8610FF2884001E145F /* ASIS3BucketObject.h */,
- B5873F8710FF2884001E145F /* ASIS3BucketObject.m */,
B5873F8A10FF2884001E145F /* ASIS3Request.h */,
B5873F8B10FF2884001E145F /* ASIS3Request.m */,
);
+ name = Requests;
+ sourceTree = "";
+ };
+ 3F4BF1D8191C76C00047A6E7 /* Objects */ = {
+ isa = PBXGroup;
+ children = (
+ B5403FE61151149E00D8BE63 /* ASIS3Bucket.h */,
+ B5403FE71151149E00D8BE63 /* ASIS3Bucket.m */,
+ B5873F8610FF2884001E145F /* ASIS3BucketObject.h */,
+ B5873F8710FF2884001E145F /* ASIS3BucketObject.m */,
+ );
+ name = Objects;
+ sourceTree = "";
+ };
+ 3F4BF1D9191CB58B0047A6E7 /* SCS */ = {
+ isa = PBXGroup;
+ children = (
+ 3F4BF1DA191CB5A60047A6E7 /* ASISCSRequestTests.h */,
+ 3F4BF1DB191CB5A60047A6E7 /* ASISCSRequestTests.m */,
+ );
+ name = SCS;
+ sourceTree = "";
+ };
+ B51E61A2100BA84C004A300D /* S3 */ = {
+ isa = PBXGroup;
+ children = (
+ 3F4BF1D8191C76C00047A6E7 /* Objects */,
+ 3F4BF1D7191C76B80047A6E7 /* Requests */,
+ );
name = S3;
sourceTree = "";
};
@@ -335,6 +362,7 @@
B55B5D190F76568E0064029C /* Tests */ = {
isa = PBXGroup;
children = (
+ 3F4BF1D9191CB58B0047A6E7 /* SCS */,
B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */,
B565297D101C8D01000499CF /* ASITestCase.h */,
B565297C101C8D01000499CF /* ASITestCase.m */,
@@ -530,7 +558,6 @@
B55B60100F7659960064029C /* ASIFormDataRequest.m in Sources */,
B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */,
B565297E101C8D01000499CF /* ASITestCase.m in Sources */,
- 3F4BF1D6191B86610047A6E7 /* ASIS3RequestTests.m in Sources */,
B522D71F103074AC009A2D22 /* ASIInputStream.m in Sources */,
B5873F8C10FF2884001E145F /* ASIS3BucketObject.m in Sources */,
B5873F8E10FF2884001E145F /* ASIS3Request.m in Sources */,
@@ -543,6 +570,7 @@
B5873FA410FF2890001E145F /* ASICloudFilesRequest.m in Sources */,
B5403FEE1151149E00D8BE63 /* ASIS3Bucket.m in Sources */,
B5403FEF1151149E00D8BE63 /* ASIS3BucketRequest.m in Sources */,
+ 3F4BF1DC191CB5A60047A6E7 /* ASISCSRequestTests.m in Sources */,
B5403FF01151149E00D8BE63 /* ASIS3ObjectRequest.m in Sources */,
B5403FF11151149E00D8BE63 /* ASIS3ServiceRequest.m in Sources */,
B552535D11D23EBB00F9B170 /* ASIDownloadCache.m in Sources */,
From 9601a2743cdb193182f94fe7f957deaed1dcd006 Mon Sep 17 00:00:00 2001
From: Bruce Chen <662005@qq.com>
Date: Sun, 11 May 2014 14:16:10 +0800
Subject: [PATCH 07/37] update
---
Classes/S3/ASIS3BucketRequest.m | 2 +-
Classes/S3/ASIS3ObjectRequest.m | 4 +++-
Classes/Tests/ASISCSRequestTests.m | 27 ++++++++++++++++++++++-----
Mac.xcodeproj/project.pbxproj | 16 ++++++++--------
4 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/Classes/S3/ASIS3BucketRequest.m b/Classes/S3/ASIS3BucketRequest.m
index f4e6a8a7..cdbfa6c0 100644
--- a/Classes/S3/ASIS3BucketRequest.m
+++ b/Classes/S3/ASIS3BucketRequest.m
@@ -140,7 +140,7 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
} else if ([elementName isEqualToString:@"Prefix"] && [[self currentXMLElementStack] count] > 2 && [[[self currentXMLElementStack] objectAtIndex:[[self currentXMLElementStack] count]-2] isEqualToString:@"CommonPrefixes"]) {
[[self commonPrefixes] addObject:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"IsTruncated"]) {
- [self setIsTruncated:[[self currentXMLElementContent] isEqualToString:@"true"]];
+ [self setIsTruncated:[[self currentXMLElementContent] isEqualToString:@"True"]];
} else {
// Let ASIS3Request look for error messages
[super parser:parser didEndElement:elementName namespaceURI:namespaceURI qualifiedName:qName];
diff --git a/Classes/S3/ASIS3ObjectRequest.m b/Classes/S3/ASIS3ObjectRequest.m
index 99442bba..d032aa91 100644
--- a/Classes/S3/ASIS3ObjectRequest.m
+++ b/Classes/S3/ASIS3ObjectRequest.m
@@ -137,7 +137,9 @@ - (NSMutableDictionary *)S3Headers
NSMutableDictionary *headers = [super S3Headers];
if ([self sourceKey]) {
NSString *path = [ASIS3Request stringByURLEncodingForS3Path:[self sourceKey]];
- [headers setObject:[[self sourceBucket] stringByAppendingString:path] forKey:@"x-amz-copy-source"];
+ NSString *copySource = [NSString stringWithFormat:@"/%@%@", [self sourceBucket], path];
+ [headers setObject:copySource forKey:@"x-amz-copy-source"];
+ //[headers setObject:[[self sourceBucket] stringByAppendingString:path] forKey:@"x-amz-copy-source"];
}
if ([self storageClass]) {
[headers setObject:[self storageClass] forKey:@"x-amz-storage-class"];
diff --git a/Classes/Tests/ASISCSRequestTests.m b/Classes/Tests/ASISCSRequestTests.m
index a005ebdc..3ec6f1a3 100644
--- a/Classes/Tests/ASISCSRequestTests.m
+++ b/Classes/Tests/ASISCSRequestTests.m
@@ -76,17 +76,16 @@ - (void)testListBucket {
[serviceRequest setSecretAccessKey:secretAccessKey];
[serviceRequest setAccessKey:accessKey];
- [self prepare];
+ //[self prepare];
[serviceRequest startSynchronous];
- /*
+
[self logRequest:serviceRequest];
GHTestLog(@"%@", [serviceRequest buckets]);
GHAssertNil([serviceRequest error], [NSString stringWithFormat:@"%@, %@", [[serviceRequest error] description], [serviceRequest url]]);
- */
}
- (void)testFailure
@@ -144,6 +143,7 @@ - (void)testFailure
- (void)createTestBucket
{
+ return;
/*
if (!bucket) {
@@ -169,12 +169,14 @@ - (void)testREST
GHAssertTrue(success, @"You need to supply your S3 access details to run the REST test (see the top of ASIS3RequestTests.m)");
// Test creating a bucket
+ /*
ASIS3BucketRequest *bucketRequest = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
[bucketRequest setSecretAccessKey:secretAccessKey];
[bucketRequest setAccessKey:accessKey];
[bucketRequest startSynchronous];
GHAssertNil([bucketRequest error],@"Failed to create a bucket");
-
+ */
+
// List buckets to make sure the bucket is there
ASIS3ServiceRequest *serviceRequest = [ASIS3ServiceRequest serviceRequest];
[serviceRequest setSecretAccessKey:secretAccessKey];
@@ -228,6 +230,7 @@ - (void)testREST
[request setSecretAccessKey:secretAccessKey];
[request setAccessKey:accessKey];
[request startSynchronous];
+ [self logRequest:request];
GHAssertNil([request error],@"Failed to COPY a file");
// GET the copy
@@ -321,11 +324,13 @@ - (void)testREST
GHAssertTrue(success,@"Failed to DELETE the file from S3");
// Delete the bucket
+ /*
bucketRequest = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
[bucketRequest setSecretAccessKey:secretAccessKey];
[bucketRequest setAccessKey:accessKey];
[bucketRequest startSynchronous];
GHAssertNil([bucketRequest error],@"Failed to delete a bucket");
+ */
}
@@ -436,7 +441,7 @@ - (void)testListRequest
[listRequest setMarker:@"bar"];
[listRequest setMaxResultCount:5];
[listRequest buildURL];
- NSString *expectedURL = [NSString stringWithFormat:@"http://%@.s3.amazonaws.com/?acl&prefix=foo&marker=bar&delimiter=/&max-keys=5",bucket];
+ NSString *expectedURL = [NSString stringWithFormat:@"http://%@.sinastorage.com/?acl&prefix=foo&marker=bar&delimiter=/&max-keys=5",bucket];
success = ([[[listRequest url] absoluteString] isEqualToString:expectedURL]);
GHAssertTrue(success,@"Generated the wrong url when requesting a subresource");
@@ -714,11 +719,15 @@ - (void)testHTTPS
[ASIS3Request setSharedSecretAccessKey:secretAccessKey];
// Create a bucket
+ /*
ASIS3Request *request = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
[request setValidatesSecureCertificate:NO];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to create a bucket");
+ */
+
+ ASIS3Request *request;
// PUT something in it
NSString *key = @"king";
@@ -743,10 +752,12 @@ - (void)testHTTPS
GHAssertTrue(success,@"Failed to DELETE the object from S3");
// Delete the bucket
+ /*
request = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to delete a bucket");
+ */
[ASIS3Request setSharedAccessKey:nil];
[ASIS3Request setSharedSecretAccessKey:nil];
@@ -759,10 +770,14 @@ - (void)testCannedACLs
[ASIS3Request setSharedSecretAccessKey:secretAccessKey];
// Create a bucket
+ /*
ASIS3Request *request = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to create a bucket");
+ */
+
+ ASIS3Request *request;
NSArray *ACLs = [NSArray arrayWithObjects:ASIS3AccessPolicyPrivate, ASIS3AccessPolicyPublicRead, ASIS3AccessPolicyPublicReadWrite, ASIS3AccessPolicyAuthenticatedRead, nil];
@@ -792,10 +807,12 @@ - (void)testCannedACLs
GHAssertTrue(success,@"Failed to DELETE the object from S3");
// Delete the bucket
+ /*
request = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to delete a bucket");
+ */
[ASIS3Request setSharedAccessKey:nil];
[ASIS3Request setSharedSecretAccessKey:nil];
diff --git a/Mac.xcodeproj/project.pbxproj b/Mac.xcodeproj/project.pbxproj
index f74cabb2..c1087b1e 100644
--- a/Mac.xcodeproj/project.pbxproj
+++ b/Mac.xcodeproj/project.pbxproj
@@ -200,6 +200,14 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
+ B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */,
+ B51791281024BF0F00583567 /* Security.framework */,
+ B50C17DA121C254D0055FCAB /* Security.framework */,
+ B50C18D1121C2F240055FCAB /* Foundation.framework */,
+ B53E62551255EC4600C1E79A /* libxml2.dylib */,
+ B53E62571255EC4E00C1E79A /* libtidy.dylib */,
+ B551D5C613ED432B00607B74 /* libz.dylib */,
+ B53E62B01255EEB800C1E79A /* WebKit.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
B5BF64E512FDE9C900CBC324 /* GHUnit.framework */,
);
@@ -233,14 +241,6 @@
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
- B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */,
- B51791281024BF0F00583567 /* Security.framework */,
- B50C17DA121C254D0055FCAB /* Security.framework */,
- B50C18D1121C2F240055FCAB /* Foundation.framework */,
- B53E62551255EC4600C1E79A /* libxml2.dylib */,
- B53E62571255EC4E00C1E79A /* libtidy.dylib */,
- B551D5C613ED432B00607B74 /* libz.dylib */,
- B53E62B01255EEB800C1E79A /* WebKit.framework */,
);
name = Mac;
sourceTree = "";
From a04882c3c81e6136afedcf3078162ec8f4e0f690 Mon Sep 17 00:00:00 2001
From: Bruce Chen <662005@qq.com>
Date: Mon, 12 May 2014 11:49:12 +0800
Subject: [PATCH 08/37] update
---
Classes/ASIHTTPRequest.m | 2 +-
Classes/S3/ASIS3BucketRequest.m | 3 +-
Classes/Tests/ASISCSRequestTests.m | 13 ++++++-
iPhone.xcodeproj/project.pbxproj | 54 +++++++++++++++++++++++-------
4 files changed, 57 insertions(+), 15 deletions(-)
diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m
index 6d2fb47c..c89031bd 100644
--- a/Classes/ASIHTTPRequest.m
+++ b/Classes/ASIHTTPRequest.m
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
-NSString *ASIHTTPRequestVersion = @"v1.8.2-11 2014-05-09";
+NSString *ASIHTTPRequestVersion = @"v1.8.2-13 2014-05-12";
static NSString *defaultUserAgent = nil;
diff --git a/Classes/S3/ASIS3BucketRequest.m b/Classes/S3/ASIS3BucketRequest.m
index cdbfa6c0..9a6b1b5a 100644
--- a/Classes/S3/ASIS3BucketRequest.m
+++ b/Classes/S3/ASIS3BucketRequest.m
@@ -128,7 +128,8 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
} else if ([elementName isEqualToString:@"Key"]) {
[[self currentObject] setKey:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"LastModified"]) {
- [[self currentObject] setLastModified:[[ASIS3Request S3ResponseDateFormatter] dateFromString:[self currentXMLElementContent]]];
+ //[[self currentObject] setLastModified:[[ASIS3Request S3ResponseDateFormatter] dateFromString:[self currentXMLElementContent]]];
+ [[self currentObject] setLastModified:[[ASIS3Request S3RequestDateFormatter] dateFromString:[self currentXMLElementContent]]];
} else if ([elementName isEqualToString:@"ETag"]) {
[[self currentObject] setETag:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"Size"]) {
diff --git a/Classes/Tests/ASISCSRequestTests.m b/Classes/Tests/ASISCSRequestTests.m
index 3ec6f1a3..efd1e621 100644
--- a/Classes/Tests/ASISCSRequestTests.m
+++ b/Classes/Tests/ASISCSRequestTests.m
@@ -373,7 +373,7 @@ - (void)testGZippedContent
GHAssertTrue(success,@"Failed to GET the correct data from S3");
// Now grab the data using something other than ASIHTTPRequest to ensure other HTTP clients can parse the gzipped content
- NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.s3.amazonaws.com/gzipped-data",bucket]]] returningResponse:NULL error:NULL];
+ NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.sinastorage.com.com/gzipped-data",bucket]]] returningResponse:NULL error:NULL];
NSString *string = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
success = [string isEqualToString:text];
GHAssertTrue(success,@"Failed to GET the correct data from S3");
@@ -414,6 +414,8 @@ - (void)testListRequest
[listRequest setAccessKey:accessKey];
[listRequest setDelimiter:@"/"];
[listRequest startSynchronous];
+ [self logRequest:listRequest];
+ GHTestLog(@"%@", listRequest.objects);
GHAssertNil([listRequest error],@"Failed to download a list from S3");
success = NO;
for (NSString *prefix in [listRequest commonPrefixes]) {
@@ -430,6 +432,7 @@ - (void)testListRequest
[listRequest setAccessKey:accessKey];
[listRequest setMaxResultCount:1];
[listRequest startSynchronous];
+ [self logRequest:listRequest];
GHAssertTrue([listRequest isTruncated],@"Failed to identify what should be a truncated list of results");
// Test urls are built correctly when requesting a subresource
@@ -452,6 +455,7 @@ - (void)testListRequest
[listRequest setSecretAccessKey:secretAccessKey];
[listRequest setAccessKey:accessKey];
[listRequest startSynchronous];
+ [self logRequest:listRequest];
GHAssertNil([listRequest error],@"Failed to download a list from S3");
success = ([[listRequest objects] count] == 5);
GHAssertTrue(success,@"List did not contain all files");
@@ -522,6 +526,7 @@ - (void)testListRequest
- (void)GETRequestDone:(ASIS3Request *)request
{
+ [self logRequest:request];
NSString *expectedContent = [NSString stringWithFormat:@"This is the content of file #%@",[[[request url] absoluteString] lastPathComponent]];
BOOL success = ([[request responseString] isEqualToString:expectedContent]);
GHAssertTrue(success,@"Got the wrong content when downloading one of the files");
@@ -530,24 +535,29 @@ - (void)GETRequestDone:(ASIS3Request *)request
- (void)GETRequestFailed:(ASIS3Request *)request
{
+ [self logRequest:request];
GHAssertTrue(NO,@"GET request failed for one of the items in the list");
}
- (void)PUTRequestDone:(ASIS3Request *)request
{
+ [self logRequest:request];
}
- (void)PUTRequestFailed:(ASIS3Request *)request
{
+ [self logRequest:request];
GHAssertTrue(NO,@"PUT request failed for one of the items in the list");
}
- (void)DELETERequestDone:(ASIS3Request *)request
{
+ [self logRequest:request];
}
- (void)DELETERequestFailed:(ASIS3Request *)request
{
+ [self logRequest:request];
GHAssertTrue(NO,@"DELETE request failed for one of the items in the list");
}
@@ -555,6 +565,7 @@ - (void)DELETERequestFailed:(ASIS3Request *)request
- (void)s3RequestFailed:(ASIHTTPRequest *)request
{
+ [self logRequest:request];
GHFail(@"Request failed - cannot continue with test");
[[self networkQueue] cancelAllOperations];
}
diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj
index 1aa3d4b8..d0ec0faa 100644
--- a/iPhone.xcodeproj/project.pbxproj
+++ b/iPhone.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 3F4C79AB19206F9400AAF021 /* ASISCSRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F4C79AA19206F9400AAF021 /* ASISCSRequestTests.m */; };
3FAFBA88191B2C2100609F5B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */; };
3FBBD316191B6DA8004729A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */; };
B50C182C121C26FA0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C182B121C26FA0055FCAB /* Security.framework */; };
@@ -131,6 +132,8 @@
/* Begin PBXFileReference section */
1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASIHTTPRequest iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3F4C79A919206F9400AAF021 /* ASISCSRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASISCSRequestTests.h; sourceTree = ""; };
+ 3F4C79AA19206F9400AAF021 /* ASISCSRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASISCSRequestTests.m; sourceTree = ""; };
3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "iPhone Sample/Resources/Default-568h@2x.png"; sourceTree = ""; };
B50C1821121C26DB0055FCAB /* ClientCertificateTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientCertificateTests.h; sourceTree = ""; };
B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientCertificateTests.m; sourceTree = ""; };
@@ -426,6 +429,41 @@
name = Frameworks;
sourceTree = "";
};
+ 3F4C79A619206F0100AAF021 /* SCS */ = {
+ isa = PBXGroup;
+ children = (
+ 3F4C79A919206F9400AAF021 /* ASISCSRequestTests.h */,
+ 3F4C79AA19206F9400AAF021 /* ASISCSRequestTests.m */,
+ );
+ name = SCS;
+ sourceTree = "";
+ };
+ 3F4C79A719206F0800AAF021 /* Objects */ = {
+ isa = PBXGroup;
+ children = (
+ B5403FFF115114BA00D8BE63 /* ASIS3Bucket.h */,
+ B5404000115114BA00D8BE63 /* ASIS3Bucket.m */,
+ B5873FC110FF28CA001E145F /* ASIS3BucketObject.h */,
+ B5873FC210FF28CA001E145F /* ASIS3BucketObject.m */,
+ );
+ name = Objects;
+ sourceTree = "";
+ };
+ 3F4C79A819206F0F00AAF021 /* Requests */ = {
+ isa = PBXGroup;
+ children = (
+ B5404001115114BA00D8BE63 /* ASIS3BucketRequest.h */,
+ B5404002115114BA00D8BE63 /* ASIS3BucketRequest.m */,
+ B5404003115114BA00D8BE63 /* ASIS3ObjectRequest.h */,
+ B5404004115114BA00D8BE63 /* ASIS3ObjectRequest.m */,
+ B5404005115114BA00D8BE63 /* ASIS3ServiceRequest.h */,
+ B5404006115114BA00D8BE63 /* ASIS3ServiceRequest.m */,
+ B5873FC510FF28CA001E145F /* ASIS3Request.h */,
+ B5873FC610FF28CA001E145F /* ASIS3Request.m */,
+ );
+ name = Requests;
+ sourceTree = "";
+ };
B52329A911CA3380006C6E5A /* UI helpers */ = {
isa = PBXGroup;
children = (
@@ -457,6 +495,7 @@
B55B60510F765A3C0064029C /* Tests */ = {
isa = PBXGroup;
children = (
+ 3F4C79A619206F0100AAF021 /* SCS */,
B565291E101C8BD7000499CF /* ASITestCase.h */,
B565291F101C8BD7000499CF /* ASITestCase.m */,
B55B60520F765A3C0064029C /* ASIFormDataRequestTests.h */,
@@ -497,18 +536,8 @@
B5873FC010FF28CA001E145F /* S3 */ = {
isa = PBXGroup;
children = (
- B5403FFF115114BA00D8BE63 /* ASIS3Bucket.h */,
- B5404000115114BA00D8BE63 /* ASIS3Bucket.m */,
- B5404001115114BA00D8BE63 /* ASIS3BucketRequest.h */,
- B5404002115114BA00D8BE63 /* ASIS3BucketRequest.m */,
- B5404003115114BA00D8BE63 /* ASIS3ObjectRequest.h */,
- B5404004115114BA00D8BE63 /* ASIS3ObjectRequest.m */,
- B5404005115114BA00D8BE63 /* ASIS3ServiceRequest.h */,
- B5404006115114BA00D8BE63 /* ASIS3ServiceRequest.m */,
- B5873FC110FF28CA001E145F /* ASIS3BucketObject.h */,
- B5873FC210FF28CA001E145F /* ASIS3BucketObject.m */,
- B5873FC510FF28CA001E145F /* ASIS3Request.h */,
- B5873FC610FF28CA001E145F /* ASIS3Request.m */,
+ 3F4C79A719206F0800AAF021 /* Objects */,
+ 3F4C79A819206F0F00AAF021 /* Requests */,
);
path = S3;
sourceTree = "";
@@ -765,6 +794,7 @@
B53E6D961257B45800C1E79A /* ASIDataCompressor.m in Sources */,
B57D0F4A12AA7D3600E5F992 /* ASIWebPageRequest.m in Sources */,
B5BF64EF12FDFC7100CBC324 /* GHUnitIOSTestMain.m in Sources */,
+ 3F4C79AB19206F9400AAF021 /* ASISCSRequestTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
From ed1c9a638874946e4dc97757ac26b16a21209b50 Mon Sep 17 00:00:00 2001
From: Bruce Chen <662005@qq.com>
Date: Mon, 12 May 2014 16:35:16 +0800
Subject: [PATCH 09/37] add target: "ASIKit"
---
ASIKit/ASIKit-Info.plist | 28 +++
ASIKit/ASIKit-Prefix.pch | 9 +
ASIKit/ASIKit.h | 33 +++
ASIKit/en.lproj/InfoPlist.strings | 2 +
Classes/ASIHTTPRequest.m | 2 +-
Mac.xcodeproj/project.pbxproj | 343 ++++++++++++++++++++++++++----
6 files changed, 374 insertions(+), 43 deletions(-)
create mode 100644 ASIKit/ASIKit-Info.plist
create mode 100644 ASIKit/ASIKit-Prefix.pch
create mode 100644 ASIKit/ASIKit.h
create mode 100644 ASIKit/en.lproj/InfoPlist.strings
diff --git a/ASIKit/ASIKit-Info.plist b/ASIKit/ASIKit-Info.plist
new file mode 100644
index 00000000..81872ec6
--- /dev/null
+++ b/ASIKit/ASIKit-Info.plist
@@ -0,0 +1,28 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ com.sina.${PRODUCT_NAME:rfc1034identifier}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+ NSPrincipalClass
+
+
+
diff --git a/ASIKit/ASIKit-Prefix.pch b/ASIKit/ASIKit-Prefix.pch
new file mode 100644
index 00000000..35d76409
--- /dev/null
+++ b/ASIKit/ASIKit-Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#ifdef __OBJC__
+ #import
+#endif
diff --git a/ASIKit/ASIKit.h b/ASIKit/ASIKit.h
new file mode 100644
index 00000000..aeb1c620
--- /dev/null
+++ b/ASIKit/ASIKit.h
@@ -0,0 +1,33 @@
+//
+// ASIKit.h
+// ASIKit
+//
+// Created by Bruce on 14-5-12.
+//
+//
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
\ No newline at end of file
diff --git a/ASIKit/en.lproj/InfoPlist.strings b/ASIKit/en.lproj/InfoPlist.strings
new file mode 100644
index 00000000..477b28ff
--- /dev/null
+++ b/ASIKit/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m
index c89031bd..d99c54cb 100644
--- a/Classes/ASIHTTPRequest.m
+++ b/Classes/ASIHTTPRequest.m
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
-NSString *ASIHTTPRequestVersion = @"v1.8.2-13 2014-05-12";
+NSString *ASIHTTPRequestVersion = @"v1.8.2-14 2014-05-12";
static NSString *defaultUserAgent = nil;
diff --git a/Mac.xcodeproj/project.pbxproj b/Mac.xcodeproj/project.pbxproj
index c1087b1e..612457b5 100644
--- a/Mac.xcodeproj/project.pbxproj
+++ b/Mac.xcodeproj/project.pbxproj
@@ -8,27 +8,74 @@
/* Begin PBXBuildFile section */
3F4BF1DC191CB5A60047A6E7 /* ASISCSRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F4BF1DB191CB5A60047A6E7 /* ASISCSRequestTests.m */; };
+ 3FC0705119209C78004C6C27 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F4C79DD1920806C00AAF021 /* Cocoa.framework */; };
+ 3FC0705719209C78004C6C27 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3FC0705519209C78004C6C27 /* InfoPlist.strings */; };
+ 3FC0707519209D3F004C6C27 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
+ 3FC0707619209D3F004C6C27 /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D120F76568E0064029C /* ASIFormDataRequest.m */; };
+ 3FC0707719209D3F004C6C27 /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D140F76568E0064029C /* ASIHTTPRequest.m */; };
+ 3FC0707819209D3F004C6C27 /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D160F76568E0064029C /* ASINetworkQueue.m */; };
+ 3FC0707919209D3F004C6C27 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B552535A11D23EBB00F9B170 /* ASIDownloadCache.m */; };
+ 3FC0707A19209D3F004C6C27 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E626F1255ED8700C1E79A /* ASIDataCompressor.m */; };
+ 3FC0707B19209D3F004C6C27 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E628D1255EE4B00C1E79A /* ASIDataDecompressor.m */; };
+ 3FC0707C19209D3F004C6C27 /* ASIWebPageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B54B23F912AA7D9100A7F940 /* ASIWebPageRequest.m */; };
+ 3FC0707D19209D3F004C6C27 /* ASICloudFilesCDNRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9110FF2890001E145F /* ASICloudFilesCDNRequest.m */; };
+ 3FC0707E19209D3F004C6C27 /* ASICloudFilesContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9310FF2890001E145F /* ASICloudFilesContainer.m */; };
+ 3FC0707F19209D3F004C6C27 /* ASICloudFilesContainerRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9510FF2890001E145F /* ASICloudFilesContainerRequest.m */; };
+ 3FC0708019209D3F004C6C27 /* ASICloudFilesContainerXMLParserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9710FF2890001E145F /* ASICloudFilesContainerXMLParserDelegate.m */; };
+ 3FC0708119209D3F004C6C27 /* ASICloudFilesObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9910FF2890001E145F /* ASICloudFilesObject.m */; };
+ 3FC0708219209D3F004C6C27 /* ASICloudFilesObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9B10FF2890001E145F /* ASICloudFilesObjectRequest.m */; };
+ 3FC0708319209D3F004C6C27 /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9D10FF2890001E145F /* ASICloudFilesRequest.m */; };
+ 3FC0708419209D3F004C6C27 /* ASIS3Bucket.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FE71151149E00D8BE63 /* ASIS3Bucket.m */; };
+ 3FC0708519209D3F004C6C27 /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F8710FF2884001E145F /* ASIS3BucketObject.m */; };
+ 3FC0708619209D3F004C6C27 /* ASIS3BucketRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FE91151149E00D8BE63 /* ASIS3BucketRequest.m */; };
+ 3FC0708719209D3F004C6C27 /* ASIS3ObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FEB1151149E00D8BE63 /* ASIS3ObjectRequest.m */; };
+ 3FC0708819209D3F004C6C27 /* ASIS3ServiceRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FED1151149E00D8BE63 /* ASIS3ServiceRequest.m */; };
+ 3FC0708919209D3F004C6C27 /* ASIS3Request.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F8B10FF2884001E145F /* ASIS3Request.m */; };
+ 3FC0708A19209D7F004C6C27 /* ASIHTTPRequestConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = B551DD3310D6AB6B00EC1CBF /* ASIHTTPRequestConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0708B19209D7F004C6C27 /* ASIProgressDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5747B3A11746CF500C9414E /* ASIProgressDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0708C19209D7F004C6C27 /* ASIHTTPRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5747EA91174B1C100C9414E /* ASIHTTPRequestDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0708D19209D7F004C6C27 /* ASIInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = B522D71D103074AC009A2D22 /* ASIInputStream.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0708E19209D7F004C6C27 /* ASIFormDataRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B55B5D110F76568E0064029C /* ASIFormDataRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0708F19209D7F004C6C27 /* ASIHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B55B5D130F76568E0064029C /* ASIHTTPRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709019209D7F004C6C27 /* ASINetworkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = B55B5D150F76568E0064029C /* ASINetworkQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709119209D7F004C6C27 /* ASICacheDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B552535C11D23EBB00F9B170 /* ASICacheDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709219209D7F004C6C27 /* ASIDownloadCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B552535B11D23EBB00F9B170 /* ASIDownloadCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709319209D7F004C6C27 /* ASIDataCompressor.h in Headers */ = {isa = PBXBuildFile; fileRef = B53E62701255ED8700C1E79A /* ASIDataCompressor.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709419209D7F004C6C27 /* ASIDataDecompressor.h in Headers */ = {isa = PBXBuildFile; fileRef = B53E628E1255EE4B00C1E79A /* ASIDataDecompressor.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709519209D7F004C6C27 /* ASIWebPageRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B54B23F812AA7D9100A7F940 /* ASIWebPageRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709619209D7F004C6C27 /* ASINSXMLParserCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = B5BD2BE611CA5EBC00D7C426 /* ASINSXMLParserCompat.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709719209D7F004C6C27 /* ASICloudFilesCDNRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9010FF2890001E145F /* ASICloudFilesCDNRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709819209D7F004C6C27 /* ASICloudFilesContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9210FF2890001E145F /* ASICloudFilesContainer.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709919209D7F004C6C27 /* ASICloudFilesContainerRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9410FF2890001E145F /* ASICloudFilesContainerRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709A19209D7F004C6C27 /* ASICloudFilesContainerXMLParserDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9610FF2890001E145F /* ASICloudFilesContainerXMLParserDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709B19209D7F004C6C27 /* ASICloudFilesObject.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9810FF2890001E145F /* ASICloudFilesObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709C19209D7F004C6C27 /* ASICloudFilesObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9A10FF2890001E145F /* ASICloudFilesObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709D19209D7F004C6C27 /* ASICloudFilesRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F9C10FF2890001E145F /* ASICloudFilesRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709E19209D7F004C6C27 /* ASIS3Bucket.h in Headers */ = {isa = PBXBuildFile; fileRef = B5403FE61151149E00D8BE63 /* ASIS3Bucket.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC0709F19209D7F004C6C27 /* ASIS3BucketObject.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F8610FF2884001E145F /* ASIS3BucketObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC070A019209D7F004C6C27 /* ASIS3BucketRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5403FE81151149E00D8BE63 /* ASIS3BucketRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC070A119209D7F004C6C27 /* ASIS3ObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5403FEA1151149E00D8BE63 /* ASIS3ObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC070A219209D7F004C6C27 /* ASIS3ServiceRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5403FEC1151149E00D8BE63 /* ASIS3ServiceRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC070A319209D7F004C6C27 /* ASIS3Request.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873F8A10FF2884001E145F /* ASIS3Request.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC070A419209D7F004C6C27 /* ASIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FC0705919209C78004C6C27 /* ASIKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 3FC070A519209DD7004C6C27 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
+ 3FC070A619209DDC004C6C27 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C17DA121C254D0055FCAB /* Security.framework */; };
+ 3FC070A719209DF2004C6C27 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B53E62551255EC4600C1E79A /* libxml2.dylib */; };
+ 3FC070A819209DFA004C6C27 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B551D5C613ED432B00607B74 /* libz.dylib */; };
+ 3FC070A919209E88004C6C27 /* ASIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FC0705019209C78004C6C27 /* ASIKit.framework */; };
+ 3FC070AA19209E8E004C6C27 /* ASIKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3FC0705019209C78004C6C27 /* ASIKit.framework */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
B50C17DB121C254D0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C17DA121C254D0055FCAB /* Security.framework */; };
- B522D71F103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
B522D720103074AC009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522D71E103074AC009A2D22 /* ASIInputStream.m */; };
B522DE601031BB03009A2D22 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
B522DE821031BD5E009A2D22 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53FADE70FF38B2A002E2DE6 /* SystemConfiguration.framework */; };
B53E62561255EC4600C1E79A /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B53E62551255EC4600C1E79A /* libxml2.dylib */; };
- B53E62711255ED8700C1E79A /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E626F1255ED8700C1E79A /* ASIDataCompressor.m */; };
B53E62721255ED8700C1E79A /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E626F1255ED8700C1E79A /* ASIDataCompressor.m */; };
- B53E628F1255EE4B00C1E79A /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E628D1255EE4B00C1E79A /* ASIDataDecompressor.m */; };
B53E62901255EE4B00C1E79A /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E628D1255EE4B00C1E79A /* ASIDataDecompressor.m */; };
B53E62B11255EEB800C1E79A /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53E62B01255EEB800C1E79A /* WebKit.framework */; };
B53E62DC1255F6FC00C1E79A /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B53E62551255EC4600C1E79A /* libxml2.dylib */; };
- B5403FEE1151149E00D8BE63 /* ASIS3Bucket.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FE71151149E00D8BE63 /* ASIS3Bucket.m */; };
- B5403FEF1151149E00D8BE63 /* ASIS3BucketRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FE91151149E00D8BE63 /* ASIS3BucketRequest.m */; };
- B5403FF01151149E00D8BE63 /* ASIS3ObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FEB1151149E00D8BE63 /* ASIS3ObjectRequest.m */; };
- B5403FF11151149E00D8BE63 /* ASIS3ServiceRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5403FED1151149E00D8BE63 /* ASIS3ServiceRequest.m */; };
- B54B23FA12AA7D9100A7F940 /* ASIWebPageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B54B23F912AA7D9100A7F940 /* ASIWebPageRequest.m */; };
B54B23FB12AA7D9100A7F940 /* ASIWebPageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B54B23F912AA7D9100A7F940 /* ASIWebPageRequest.m */; };
B551D5C713ED432B00607B74 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B551D5C613ED432B00607B74 /* libz.dylib */; };
- B552535D11D23EBB00F9B170 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B552535A11D23EBB00F9B170 /* ASIDownloadCache.m */; };
B552536111D23ECD00F9B170 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B552535A11D23EBB00F9B170 /* ASIDownloadCache.m */; };
B55B5D200F76568E0064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D120F76568E0064029C /* ASIFormDataRequest.m */; };
B55B5D210F76568E0064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D140F76568E0064029C /* ASIHTTPRequest.m */; };
@@ -36,20 +83,8 @@
B55B5E700F7656A40064029C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5E6E0F7656A40064029C /* main.m */; };
B55B5E7F0F76573B0064029C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B55B5E730F7656DA0064029C /* MainMenu.xib */; };
B55B5ED20F76588D0064029C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5ED10F76588D0064029C /* AppDelegate.m */; };
- B55B600C0F7659880064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D160F76568E0064029C /* ASINetworkQueue.m */; };
- B55B600F0F7659900064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D140F76568E0064029C /* ASIHTTPRequest.m */; };
- B55B60100F7659960064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D120F76568E0064029C /* ASIFormDataRequest.m */; };
B565297E101C8D01000499CF /* ASITestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = B565297C101C8D01000499CF /* ASITestCase.m */; };
B56DF2BA13ED5C4100549DCD /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B551D5C613ED432B00607B74 /* libz.dylib */; };
- B5873F8C10FF2884001E145F /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F8710FF2884001E145F /* ASIS3BucketObject.m */; };
- B5873F8E10FF2884001E145F /* ASIS3Request.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F8B10FF2884001E145F /* ASIS3Request.m */; };
- B5873F9E10FF2890001E145F /* ASICloudFilesCDNRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9110FF2890001E145F /* ASICloudFilesCDNRequest.m */; };
- B5873F9F10FF2890001E145F /* ASICloudFilesContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9310FF2890001E145F /* ASICloudFilesContainer.m */; };
- B5873FA010FF2890001E145F /* ASICloudFilesContainerRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9510FF2890001E145F /* ASICloudFilesContainerRequest.m */; };
- B5873FA110FF2890001E145F /* ASICloudFilesContainerXMLParserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9710FF2890001E145F /* ASICloudFilesContainerXMLParserDelegate.m */; };
- B5873FA210FF2890001E145F /* ASICloudFilesObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9910FF2890001E145F /* ASICloudFilesObject.m */; };
- B5873FA310FF2890001E145F /* ASICloudFilesObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9B10FF2890001E145F /* ASICloudFilesObjectRequest.m */; };
- B5873FA410FF2890001E145F /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873F9D10FF2890001E145F /* ASICloudFilesRequest.m */; };
B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */; };
B5BF64E612FDE9CA00CBC324 /* GHUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5BF64E512FDE9C900CBC324 /* GHUnit.framework */; };
B5ED5A9412FEBAEC00A12511 /* GHUnit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5BF64E512FDE9C900CBC324 /* GHUnit.framework */; };
@@ -62,6 +97,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ 3FC070AA19209E8E004C6C27 /* ASIKit.framework in CopyFiles */,
B5ED5A9412FEBAEC00A12511 /* GHUnit.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -75,6 +111,12 @@
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; };
3F4BF1DA191CB5A60047A6E7 /* ASISCSRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASISCSRequestTests.h; sourceTree = ""; };
3F4BF1DB191CB5A60047A6E7 /* ASISCSRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASISCSRequestTests.m; sourceTree = ""; };
+ 3F4C79DD1920806C00AAF021 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 3FC0705019209C78004C6C27 /* ASIKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ASIKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3FC0705419209C78004C6C27 /* ASIKit-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ASIKit-Info.plist"; sourceTree = ""; };
+ 3FC0705619209C78004C6C27 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
+ 3FC0705819209C78004C6C27 /* ASIKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASIKit-Prefix.pch"; sourceTree = ""; };
+ 3FC0705919209C78004C6C27 /* ASIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASIKit.h; sourceTree = ""; };
8D1107320486CEB800E47090 /* Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mac.app; sourceTree = BUILT_PRODUCTS_DIR; };
B50244191025D36B002B13E1 /* ProxyTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyTests.h; sourceTree = ""; };
B502441A1025D36B002B13E1 /* ProxyTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyTests.m; sourceTree = ""; };
@@ -170,6 +212,18 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ 3FC0704C19209C78004C6C27 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 3FC070A819209DFA004C6C27 /* libz.dylib in Frameworks */,
+ 3FC070A719209DF2004C6C27 /* libxml2.dylib in Frameworks */,
+ 3FC070A619209DDC004C6C27 /* Security.framework in Frameworks */,
+ 3FC070A519209DD7004C6C27 /* SystemConfiguration.framework in Frameworks */,
+ 3FC0705119209C78004C6C27 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -186,6 +240,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 3FC070A919209E88004C6C27 /* ASIKit.framework in Frameworks */,
B551D5C713ED432B00607B74 /* libz.dylib in Frameworks */,
B522DE601031BB03009A2D22 /* SystemConfiguration.framework in Frameworks */,
B50C17DB121C254D0055FCAB /* Security.framework in Frameworks */,
@@ -229,6 +284,7 @@
children = (
8D1107320486CEB800E47090 /* Mac.app */,
B55B5EDF0F7658C70064029C /* Unit Tests (GHUnit).app */,
+ 3FC0705019209C78004C6C27 /* ASIKit.framework */,
);
name = Products;
sourceTree = "";
@@ -239,6 +295,7 @@
B55B5D100F76568E0064029C /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
+ 3FC0705219209C78004C6C27 /* ASIKit */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
@@ -272,6 +329,7 @@
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 3F4C79DD1920806C00AAF021 /* Cocoa.framework */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
@@ -312,6 +370,25 @@
name = SCS;
sourceTree = "";
};
+ 3FC0705219209C78004C6C27 /* ASIKit */ = {
+ isa = PBXGroup;
+ children = (
+ 3FC0705919209C78004C6C27 /* ASIKit.h */,
+ 3FC0705319209C78004C6C27 /* Supporting Files */,
+ );
+ path = ASIKit;
+ sourceTree = "";
+ };
+ 3FC0705319209C78004C6C27 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 3FC0705419209C78004C6C27 /* ASIKit-Info.plist */,
+ 3FC0705519209C78004C6C27 /* InfoPlist.strings */,
+ 3FC0705819209C78004C6C27 /* ASIKit-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
B51E61A2100BA84C004A300D /* S3 */ = {
isa = PBXGroup;
children = (
@@ -416,7 +493,62 @@
};
/* End PBXGroup section */
+/* Begin PBXHeadersBuildPhase section */
+ 3FC0704D19209C78004C6C27 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 3FC0708A19209D7F004C6C27 /* ASIHTTPRequestConfig.h in Headers */,
+ 3FC0708B19209D7F004C6C27 /* ASIProgressDelegate.h in Headers */,
+ 3FC0708C19209D7F004C6C27 /* ASIHTTPRequestDelegate.h in Headers */,
+ 3FC0708D19209D7F004C6C27 /* ASIInputStream.h in Headers */,
+ 3FC0708E19209D7F004C6C27 /* ASIFormDataRequest.h in Headers */,
+ 3FC0708F19209D7F004C6C27 /* ASIHTTPRequest.h in Headers */,
+ 3FC0709019209D7F004C6C27 /* ASINetworkQueue.h in Headers */,
+ 3FC0709119209D7F004C6C27 /* ASICacheDelegate.h in Headers */,
+ 3FC0709219209D7F004C6C27 /* ASIDownloadCache.h in Headers */,
+ 3FC0709319209D7F004C6C27 /* ASIDataCompressor.h in Headers */,
+ 3FC0709419209D7F004C6C27 /* ASIDataDecompressor.h in Headers */,
+ 3FC0709519209D7F004C6C27 /* ASIWebPageRequest.h in Headers */,
+ 3FC0709619209D7F004C6C27 /* ASINSXMLParserCompat.h in Headers */,
+ 3FC0709719209D7F004C6C27 /* ASICloudFilesCDNRequest.h in Headers */,
+ 3FC0709819209D7F004C6C27 /* ASICloudFilesContainer.h in Headers */,
+ 3FC0709919209D7F004C6C27 /* ASICloudFilesContainerRequest.h in Headers */,
+ 3FC0709A19209D7F004C6C27 /* ASICloudFilesContainerXMLParserDelegate.h in Headers */,
+ 3FC0709B19209D7F004C6C27 /* ASICloudFilesObject.h in Headers */,
+ 3FC0709C19209D7F004C6C27 /* ASICloudFilesObjectRequest.h in Headers */,
+ 3FC0709D19209D7F004C6C27 /* ASICloudFilesRequest.h in Headers */,
+ 3FC0709E19209D7F004C6C27 /* ASIS3Bucket.h in Headers */,
+ 3FC0709F19209D7F004C6C27 /* ASIS3BucketObject.h in Headers */,
+ 3FC070A019209D7F004C6C27 /* ASIS3BucketRequest.h in Headers */,
+ 3FC070A119209D7F004C6C27 /* ASIS3ObjectRequest.h in Headers */,
+ 3FC070A219209D7F004C6C27 /* ASIS3ServiceRequest.h in Headers */,
+ 3FC070A319209D7F004C6C27 /* ASIS3Request.h in Headers */,
+ 3FC070A419209D7F004C6C27 /* ASIKit.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
/* Begin PBXNativeTarget section */
+ 3FC0704F19209C78004C6C27 /* ASIKit */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 3FC0706F19209C78004C6C27 /* Build configuration list for PBXNativeTarget "ASIKit" */;
+ buildPhases = (
+ 3FC0704B19209C78004C6C27 /* Sources */,
+ 3FC0704C19209C78004C6C27 /* Frameworks */,
+ 3FC0704D19209C78004C6C27 /* Headers */,
+ 3FC0704E19209C78004C6C27 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = ASIKit;
+ productName = ASIKit;
+ productReference = 3FC0705019209C78004C6C27 /* ASIKit.framework */;
+ productType = "com.apple.product-type.framework";
+ };
8D1107260486CEB800E47090 /* Mac */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Mac" */;
@@ -472,6 +604,7 @@
Japanese,
French,
German,
+ en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* Mac */;
projectDirPath = "";
@@ -479,11 +612,20 @@
targets = (
8D1107260486CEB800E47090 /* Mac */,
B55B5EDE0F7658C70064029C /* Unit Tests (GHUnit) */,
+ 3FC0704F19209C78004C6C27 /* ASIKit */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ 3FC0704E19209C78004C6C27 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 3FC0705719209C78004C6C27 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -532,6 +674,34 @@
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 3FC0704B19209C78004C6C27 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 3FC0708219209D3F004C6C27 /* ASICloudFilesObjectRequest.m in Sources */,
+ 3FC0708319209D3F004C6C27 /* ASICloudFilesRequest.m in Sources */,
+ 3FC0708619209D3F004C6C27 /* ASIS3BucketRequest.m in Sources */,
+ 3FC0707519209D3F004C6C27 /* ASIInputStream.m in Sources */,
+ 3FC0707F19209D3F004C6C27 /* ASICloudFilesContainerRequest.m in Sources */,
+ 3FC0707719209D3F004C6C27 /* ASIHTTPRequest.m in Sources */,
+ 3FC0708719209D3F004C6C27 /* ASIS3ObjectRequest.m in Sources */,
+ 3FC0707A19209D3F004C6C27 /* ASIDataCompressor.m in Sources */,
+ 3FC0707D19209D3F004C6C27 /* ASICloudFilesCDNRequest.m in Sources */,
+ 3FC0707919209D3F004C6C27 /* ASIDownloadCache.m in Sources */,
+ 3FC0707C19209D3F004C6C27 /* ASIWebPageRequest.m in Sources */,
+ 3FC0708419209D3F004C6C27 /* ASIS3Bucket.m in Sources */,
+ 3FC0707619209D3F004C6C27 /* ASIFormDataRequest.m in Sources */,
+ 3FC0707B19209D3F004C6C27 /* ASIDataDecompressor.m in Sources */,
+ 3FC0707E19209D3F004C6C27 /* ASICloudFilesContainer.m in Sources */,
+ 3FC0707819209D3F004C6C27 /* ASINetworkQueue.m in Sources */,
+ 3FC0708119209D3F004C6C27 /* ASICloudFilesObject.m in Sources */,
+ 3FC0708819209D3F004C6C27 /* ASIS3ServiceRequest.m in Sources */,
+ 3FC0708919209D3F004C6C27 /* ASIS3Request.m in Sources */,
+ 3FC0708519209D3F004C6C27 /* ASIS3BucketObject.m in Sources */,
+ 3FC0708019209D3F004C6C27 /* ASICloudFilesContainerXMLParserDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -553,36 +723,23 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- B55B600C0F7659880064029C /* ASINetworkQueue.m in Sources */,
- B55B600F0F7659900064029C /* ASIHTTPRequest.m in Sources */,
- B55B60100F7659960064029C /* ASIFormDataRequest.m in Sources */,
B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */,
B565297E101C8D01000499CF /* ASITestCase.m in Sources */,
- B522D71F103074AC009A2D22 /* ASIInputStream.m in Sources */,
- B5873F8C10FF2884001E145F /* ASIS3BucketObject.m in Sources */,
- B5873F8E10FF2884001E145F /* ASIS3Request.m in Sources */,
- B5873F9E10FF2890001E145F /* ASICloudFilesCDNRequest.m in Sources */,
- B5873F9F10FF2890001E145F /* ASICloudFilesContainer.m in Sources */,
- B5873FA010FF2890001E145F /* ASICloudFilesContainerRequest.m in Sources */,
- B5873FA110FF2890001E145F /* ASICloudFilesContainerXMLParserDelegate.m in Sources */,
- B5873FA210FF2890001E145F /* ASICloudFilesObject.m in Sources */,
- B5873FA310FF2890001E145F /* ASICloudFilesObjectRequest.m in Sources */,
- B5873FA410FF2890001E145F /* ASICloudFilesRequest.m in Sources */,
- B5403FEE1151149E00D8BE63 /* ASIS3Bucket.m in Sources */,
- B5403FEF1151149E00D8BE63 /* ASIS3BucketRequest.m in Sources */,
3F4BF1DC191CB5A60047A6E7 /* ASISCSRequestTests.m in Sources */,
- B5403FF01151149E00D8BE63 /* ASIS3ObjectRequest.m in Sources */,
- B5403FF11151149E00D8BE63 /* ASIS3ServiceRequest.m in Sources */,
- B552535D11D23EBB00F9B170 /* ASIDownloadCache.m in Sources */,
- B53E62711255ED8700C1E79A /* ASIDataCompressor.m in Sources */,
- B53E628F1255EE4B00C1E79A /* ASIDataDecompressor.m in Sources */,
- B54B23FA12AA7D9100A7F940 /* ASIWebPageRequest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
+ 3FC0705519209C78004C6C27 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 3FC0705619209C78004C6C27 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "";
+ };
B55B5E730F7656DA0064029C /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
@@ -602,6 +759,100 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ 3FC0707019209C78004C6C27 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = NO;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = NO;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ASIKit/ASIKit-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "${SDK_DIR}/usr/include/libxml2",
+ );
+ INFOPLIST_FILE = "ASIKit/ASIKit-Info.plist";
+ INSTALL_PATH = "@executable_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 3FC0707119209C78004C6C27 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = NO;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ ENABLE_NS_ASSERTIONS = NO;
+ FRAMEWORK_VERSION = A;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ASIKit/ASIKit-Prefix.pch";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "${SDK_DIR}/usr/include/libxml2",
+ );
+ INFOPLIST_FILE = "ASIKit/ASIKit-Info.plist";
+ INSTALL_PATH = "@executable_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
B55B5EE20F7658C80064029C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B515507810BD56E800608267 /* strict.xcconfig */;
@@ -740,6 +991,14 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 3FC0706F19209C78004C6C27 /* Build configuration list for PBXNativeTarget "ASIKit" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 3FC0707019209C78004C6C27 /* Debug */,
+ 3FC0707119209C78004C6C27 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
B55B5EE40F7658C80064029C /* Build configuration list for PBXNativeTarget "Unit Tests (GHUnit)" */ = {
isa = XCConfigurationList;
buildConfigurations = (
From 8a9a41542c8bd268f7dc24a8ad58a88617c7bc2b Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Fri, 23 May 2014 15:02:23 +0800
Subject: [PATCH 10/37] framework ASIKit-iOS
---
.gitignore | 3 +-
ASIKit-iOS/ASIKit-iOS-Info.plist | 44 +++
ASIKit-iOS/ASIKit-iOS-Prefix.pch | 9 +
ASIKit-iOS/ASIKit-iOS.h | 38 +++
ASIKit-iOS/en.lproj/InfoPlist.strings | 2 +
README.md | 258 ++++++++++++++++++
iPhone.xcodeproj/project.pbxproj | 371 ++++++++++++++++++++++++++
7 files changed, 724 insertions(+), 1 deletion(-)
create mode 100644 ASIKit-iOS/ASIKit-iOS-Info.plist
create mode 100644 ASIKit-iOS/ASIKit-iOS-Prefix.pch
create mode 100644 ASIKit-iOS/ASIKit-iOS.h
create mode 100644 ASIKit-iOS/en.lproj/InfoPlist.strings
diff --git a/.gitignore b/.gitignore
index f36b7ae7..76f8393d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,5 @@ profile
*.pbxuser
*.mode1v3
External/GHUnit/*
-.svn
\ No newline at end of file
+.svn
+Products
\ No newline at end of file
diff --git a/ASIKit-iOS/ASIKit-iOS-Info.plist b/ASIKit-iOS/ASIKit-iOS-Info.plist
new file mode 100644
index 00000000..68dabaf2
--- /dev/null
+++ b/ASIKit-iOS/ASIKit-iOS-Info.plist
@@ -0,0 +1,44 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ com.sina.${PRODUCT_NAME:rfc1034identifier}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+ CFPlugInDynamicRegisterFunction
+
+ CFPlugInDynamicRegistration
+ NO
+ CFPlugInFactories
+
+ 00000000-0000-0000-0000-000000000000
+ MyFactoryFunction
+
+ CFPlugInTypes
+
+ 00000000-0000-0000-0000-000000000000
+
+ 00000000-0000-0000-0000-000000000000
+
+
+ CFPlugInUnloadFunction
+
+
+
diff --git a/ASIKit-iOS/ASIKit-iOS-Prefix.pch b/ASIKit-iOS/ASIKit-iOS-Prefix.pch
new file mode 100644
index 00000000..707192be
--- /dev/null
+++ b/ASIKit-iOS/ASIKit-iOS-Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+//
+//#ifdef __OBJC__
+// #import
+//#endif
diff --git a/ASIKit-iOS/ASIKit-iOS.h b/ASIKit-iOS/ASIKit-iOS.h
new file mode 100644
index 00000000..a7b51919
--- /dev/null
+++ b/ASIKit-iOS/ASIKit-iOS.h
@@ -0,0 +1,38 @@
+//
+// ASIKit-iOS.h
+// iPhone
+//
+// Created by Littlebox222 on 14-5-22.
+//
+//
+
+
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+
+#import
+#import
+#import
+#import
+#import
+#import
+
+#import
+#import
+#import
+#import
+#import
+#import
+#import
\ No newline at end of file
diff --git a/ASIKit-iOS/en.lproj/InfoPlist.strings b/ASIKit-iOS/en.lproj/InfoPlist.strings
new file mode 100644
index 00000000..477b28ff
--- /dev/null
+++ b/ASIKit-iOS/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/README.md b/README.md
index 7990c55a..adb92a68 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,261 @@
ASI-SCS
=======
Branch of ASIHTTPRequest for Sina Cloud Storage Service
+本SDK为ASIHTTPRequest的一个分支,熟悉ASI的同学可以轻松上手,不熟悉的也没关系,相信看完文档您一定能够运用自如,并且能够对ASI有一个初步的认识。
+
+> * 文档的详细内容请查阅:http://open.sinastorage.com/?c=doc&a=sdk
+> * SCS API 的详细内容请查阅:http://open.sinastorage.com/?c=doc&a=api
+> * ASIHTTPRequest的详细内容请查阅:http://allseeing-i.com/ASIHTTPRequest/How-to-use
+
+### SDK环境要求
+####系统版本:
+> * iOS: 6.0及以上。
+> * OSX: 10.8及以上。
+
+####相关配置:
+> * 1、将SDK文件夹拷贝到你的工程目录下;
+> * 2、打开xcode,将SCSSDK.xcodeproj拖动到你的工程中;
+> * 3、选择你的工程,在右侧选择Build Settings,并设置Other Linker Flags 为 -ObjC -all_load;
+> * 4、选择Build Phases,在Link Binary With Libraries中添加如下:
+> * _iOS_:libSCSSDK_IOS.a;Foundation.framework ;CoreData.framework ;CoreFoundation.framework ;Security.framework ;CoreGraphics.framework ;UIKit.framework;
+> * _OSX_:libSCSSDK_OSX.a;Cocoa.framework ;CoreData.framework ;CoreFoundation.framework ;Security.framework ;AppKit.framework;
+> * 5、
+
+###快速上手
+> * 以下示例为简单明确的介绍SDK使用方法,均采用同步请求方式。
+关于请求队列以及异步请求的详细介绍,请参考:【使用队列及异步请求】
+
+####Bucket操作
+#####列取bucket
+```objective-c
+ASIS3ServiceRequest *request = [ASIS3ServiceRequest serviceRequest];
+[request setSecretAccessKey:@"YourSecretAccessKey"];
+[request setAccessKey:@"YourAccessKey"];
+[request startSynchronous];
+
+if (![request error]) {
+ NSArray *buckets = [request buckets]; // An array of ASIS3Bucket objects
+}
+```
+
+#####创建bucket
+> * 为每个请求设置相应的accessKey和secretAccessKey是很繁琐的,因此我们可以设置基类(ASIS3Request)的sharedAccessKey和sharedSecretAccessKey。这样下次再发送某一请求时,无需再次设置相应的key,SDK会调用我们设置好的这两个sharedKey。
+```objective-c
+[ASIS3Request setSharedSecretAccessKey:@"YourSecretAccessKey"];
+[ASIS3Request setSharedAccessKey:@"YourAccessKey"];
+
+ASIS3BucketRequest *request = [ASIS3BucketRequest PUTRequestWithBucket:@"my-bucket"];
+[request startSynchronous];
+
+if ([request error]) {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+#####删除bucket
+> * 这里我们无需再次设置相应的accesskey,前面我们已经设置好了两个sharedKey。
+
+```objective-c
+ASIS3BucketRequest *request = [ASIS3BucketRequest DELETERequestWithBucket:@"my-bucket"];
+[request startSynchronous];
+
+if ([request error]) {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+####Object操作
+#####列取object
+```objective-c
+/*示例为列取http://my-bucket.sinastorage.com/images/jpegs中最多50个object*/
+
+ASIS3BucketRequest *listRequest = [ASIS3BucketRequest requestWithBucket:@"my-bucket"];
+[listRequest setPrefix:@"images/jpegs"];
+[listRequest setMaxResultCount:50]; // Max number of results
+[listRequest startSynchronous];
+
+if (![listRequest error]) {
+ NSLog(@"%@",[listRequest objects]);
+}
+```
+
+#####获取object信息
+```objective-c
+/*示例为获取http://my-bucket.sinastorage.com/path/to/the/object的object信息*/
+
+NSString *bucket = @"my-bucket";
+NSString *path = @"path/to/the/object";
+
+ASIS3ObjectRequest *request = [ASIS3ObjectRequest requestWithBucket:bucket key:path];
+[request startSynchronous];
+
+if (![request error]) {
+ NSData *data = [request responseData];
+} else {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+#####上传object
+```objective-c
+NSString *filePath = @"/somewhere/on/disk.txt";
+
+ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath withBucket:@"my-bucket" key:@"path/to/the/object"];
+[request startSynchronous];
+
+if ([request error]) {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+#####删除object
+```objective-c
+ASIS3ObjectRequest *request = [ASIS3ObjectRequest DELETERequestWithBucket:@"my-bucket" key:@"path/to/the/object"];
+[request startSynchronous];
+
+if ([request error]) {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+#####拷贝object
+```objective-c
+ASIS3ObjectRequest *request = [ASIS3ObjectRequest COPYRequestFromBucket:@"my-bucket" key:@"/path/to/the/object" toBucket:@"my-bucket" key:@"/new/path/to/the/object"];
+[request startSynchronous];
+
+if ([request error]) {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+#####下载object
+```objective-c
+ASIS3ObjectRequest *request = [object GETRequest];
+NSString *downloadPath = @"path/to/save/yourFile";
+[request setDownloadDestinationPath:downloadPath];
+[request startSynchronous];
+
+if ([request error]) {
+ NSLog(@"%@",[[request error] localizedDescription]);
+}
+```
+
+####使用HTTPS连接
+```objective-c
+ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath withBucket:@"my-bucket" key:@"path/to/the/object"];
+[request requestScheme:ASIS3RequestSchemeHTTPS];
+```
+
+####使用GZIP压缩
+```objective-c
+ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath withBucket:@"my-bucket" key:@"path/to/the/object"];
+[request setShouldCompressRequestBody:YES];
+```
+
+####使用队列及异步请求
+#####创建队列
+```objective-c
+//ASINetworkQueue *queue;
+[[self queue] cancelAllOperations];
+[self setQueue:[ASINetworkQueue queue]];
+```
+
+#####设置队列回调
+> * 其中selector可自定义。
+```objective-c
+ //请求成功
+ [[self queue] setRequestDidFinishSelector:@selector(requestDone:)];
+
+ //请求失败
+ [[self queue] setRequestDidFailSelector:@selector(requestFailed:)];
+
+ //请求收到响应
+ [[self queue] setRequestDidReceiveResponseHeadersSelector:@selector(requestDidReceiveResponseHeaders:)];
+
+ //请求开始
+ [[self queue] setRequestDidStartSelector:@selector(requestDidStart:)];
+
+ //即将跳转
+ [[self queue] setRequestWillRedirectSelector:@selector(requestWillRedirect:)];
+
+ //队列结束
+ [[self queue] setQueueDidFinishSelector:@selector(queueDidFinish:)];
+
+ /*默认的,若队列中某一请求失败,整个队列会停止,并取消其他请求。若如下设置为NO,则其他请求仍会继续发送*/
+ [queue setShouldCancelAllRequestsOnFailure:NO];
+```
+
+#####启动队列
+```objective-c
+ /*队列只需启动一次,此后加入队列的请求会按顺序执行*/
+ [[self queue] go];
+```
+
+#####添加异步请求
+```objective-c
+ ASIS3BucketRequest *listRequest = [ASIS3BucketRequest requestWithBucket:@"my-bucket"];
+ ...
+ [[self queue] addOperation:request];
+```
+
+#####取消异步请求
+```objective-c
+ /*取消某一请求后,队列会执行请求失败的回调*/
+ /*同时,若shouldCancelAllRequestsOnFailure == YES,队列中的其他请求也将被取消*/
+ [request cancel];
+ [request clearDelegatesAndCancel];
+```
+
+#####example
+> * 本示例较为完整的展示了如何使用队列及异步请求获取object列表并下载。
+```objective-c
+- (void)download25ImagesToDisk {
+
+ //创建队列
+ [[self queue] cancelAllOperations];
+ [self setQueue:[ASINetworkQueue queue]];
+
+ //获取图片列表
+ ASIS3BucketRequest *listRequest = [ASIS3BucketRequest requestWithBucket:@"my-bucket"];
+ [listRequest setPrefix:@"images/jpegs"];
+ [listRequest setMaxResultCount:25];
+ [listRequest setDelegate:self];
+ [listRequest setDidFinishSelector:@selector(finishedDownloadingImageList:)];
+ [listRequest setDidFailSelector:@selector(failedDownloadingImageList:)];
+ [[self queue] addOperation:listRequest];
+}
+
+- (void)failedDownloadingImageList:(ASIHTTPRequest *)listRequest {
+
+ NSLog(@"Failed downloading a list of images because '%@'", [[listRequest error] localizedDescription]);
+}
+
+- (void)finishedDownloadingImageList:(ASIHTTPRequest *)listRequest {
+
+ //获取列表成功后,开始下载
+ [[self queue] reset];
+ [[self queue] setRequestDidFinishSelector:@selector(requestDone:)];
+ [[self queue] setRequestDidFailSelector:@selector(requestFailed:)];
+ [[self queue] setDelegate:self];
+
+ int i=0;
+ for (ASIS3BucketObject *object in [listRequest objects]) {
+ ASIS3ObjectRequest *request = [object GETRequest];
+ NSString *downloadPath = [NSString stringWithFormat:@"/Users/ben/Desktop/images/%hi.jpg",i];
+ [request setDownloadDestinationPath:downloadPath];
+ [[self queue] addOperation:request];
+ i++;
+ }
+
+ //启动队列
+ [[self queue] go];
+}
+
+- (void)requestDone:(ASIS3Request *)request {
+ NSLog(@"Finished downloading an image");
+}
+
+- (void)requestFailed:(ASIS3Request *)request {
+ NSLog(@"Download error: %@",[[request error] localizedDescription]);
+}
+```
\ No newline at end of file
diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj
index d0ec0faa..ba9c72bd 100644
--- a/iPhone.xcodeproj/project.pbxproj
+++ b/iPhone.xcodeproj/project.pbxproj
@@ -6,10 +6,82 @@
objectVersion = 46;
objects = {
+/* Begin PBXAggregateTarget section */
+ AD9C70AB192DFFCA00B6416E /* ASIKit */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = AD9C70AC192DFFCA00B6416E /* Build configuration list for PBXAggregateTarget "ASIKit" */;
+ buildPhases = (
+ AD9C70AF192DFFF300B6416E /* ShellScript */,
+ );
+ dependencies = (
+ );
+ name = ASIKit;
+ productName = ASIKit;
+ };
+/* End PBXAggregateTarget section */
+
/* Begin PBXBuildFile section */
3F4C79AB19206F9400AAF021 /* ASISCSRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F4C79AA19206F9400AAF021 /* ASISCSRequestTests.m */; };
3FAFBA88191B2C2100609F5B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */; };
3FBBD316191B6DA8004729A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */; };
+ AD9C7052192DDA5600B6416E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AD9C7050192DDA5600B6416E /* InfoPlist.strings */; };
+ AD9C7058192DDB6D00B6416E /* Reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = B55252B211D22E2200F9B170 /* Reachability.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7059192DDB6D00B6416E /* ASIHTTPRequestConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = B551DB4610D6938500EC1CBF /* ASIHTTPRequestConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C705A192DDB6D00B6416E /* ASIHTTPRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5747F271174BB8300C9414E /* ASIHTTPRequestDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C705B192DDB6D00B6416E /* ASIAuthenticationDialog.h in Headers */ = {isa = PBXBuildFile; fileRef = B59A87C0103EC6F200300252 /* ASIAuthenticationDialog.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C705C192DDB6D00B6416E /* ASIInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = B522DACC1030B2AB009A2D22 /* ASIInputStream.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C705D192DDB6D00B6416E /* ASIFormDataRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B55B60450F765A320064029C /* ASIFormDataRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C705E192DDB6D00B6416E /* ASIHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B55B60470F765A320064029C /* ASIHTTPRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C705F192DDB6D00B6416E /* ASINetworkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = B55B60490F765A320064029C /* ASINetworkQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7060192DDB6D00B6416E /* ASIDownloadCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B5FE752611DBBA6400F898C8 /* ASIDownloadCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7061192DDB6D00B6416E /* ASIDataDecompressor.h in Headers */ = {isa = PBXBuildFile; fileRef = B53E6D921257B45800C1E79A /* ASIDataDecompressor.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7062192DDB6D00B6416E /* ASIDataCompressor.h in Headers */ = {isa = PBXBuildFile; fileRef = B53E6D941257B45800C1E79A /* ASIDataCompressor.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7063192DDB6D00B6416E /* ASIWebPageRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B57D0F4612AA7D3600E5F992 /* ASIWebPageRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7064192DDB6D00B6416E /* ASIS3Bucket.h in Headers */ = {isa = PBXBuildFile; fileRef = B5403FFF115114BA00D8BE63 /* ASIS3Bucket.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7065192DDB6D00B6416E /* ASIS3BucketObject.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FC110FF28CA001E145F /* ASIS3BucketObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7066192DDB6D00B6416E /* ASIS3BucketRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5404001115114BA00D8BE63 /* ASIS3BucketRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7067192DDB6D00B6416E /* ASIS3ObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5404003115114BA00D8BE63 /* ASIS3ObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7068192DDB6D00B6416E /* ASIS3ServiceRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5404005115114BA00D8BE63 /* ASIS3ServiceRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7069192DDB6D00B6416E /* ASIS3Request.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FC510FF28CA001E145F /* ASIS3Request.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C706A192DDB6D00B6416E /* ASICloudFilesCDNRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FC810FF28CA001E145F /* ASICloudFilesCDNRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C706B192DDB6D00B6416E /* ASICloudFilesContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FCA10FF28CA001E145F /* ASICloudFilesContainer.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C706C192DDB6D00B6416E /* ASICloudFilesContainerRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FCC10FF28CA001E145F /* ASICloudFilesContainerRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C706D192DDB6D00B6416E /* ASICloudFilesContainerXMLParserDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FCE10FF28CA001E145F /* ASICloudFilesContainerXMLParserDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C706E192DDB6D00B6416E /* ASICloudFilesObject.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FD010FF28CA001E145F /* ASICloudFilesObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C706F192DDB6D00B6416E /* ASICloudFilesObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FD210FF28CA001E145F /* ASICloudFilesObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7070192DDB6D00B6416E /* ASICloudFilesRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FD410FF28CA001E145F /* ASICloudFilesRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7072192DDC0700B6416E /* ASIKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9C7071192DDC0700B6416E /* ASIKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7073192DDFE400B6416E /* ASICacheDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5FE752A11DBBA6A00F898C8 /* ASICacheDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7074192DDFE400B6416E /* ASIProgressDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5747F281174BB8300C9414E /* ASIProgressDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7077192DE0CB00B6416E /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = B55252B311D22E2200F9B170 /* Reachability.m */; };
+ AD9C7078192DE0CB00B6416E /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = B59A87C1103EC6F200300252 /* ASIAuthenticationDialog.m */; };
+ AD9C7079192DE0CB00B6416E /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; };
+ AD9C707A192DE0CB00B6416E /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60460F765A320064029C /* ASIFormDataRequest.m */; };
+ AD9C707B192DE0CB00B6416E /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60480F765A320064029C /* ASIHTTPRequest.m */; };
+ AD9C707C192DE0CB00B6416E /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604A0F765A320064029C /* ASINetworkQueue.m */; };
+ AD9C707D192DE0CB00B6416E /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B5FE752511DBBA6400F898C8 /* ASIDownloadCache.m */; };
+ AD9C707E192DE0CB00B6416E /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E6D911257B45800C1E79A /* ASIDataDecompressor.m */; };
+ AD9C707F192DE0CB00B6416E /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = B53E6D931257B45800C1E79A /* ASIDataCompressor.m */; };
+ AD9C7080192DE0CB00B6416E /* ASIWebPageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B57D0F4712AA7D3600E5F992 /* ASIWebPageRequest.m */; };
+ AD9C7081192DE0CB00B6416E /* ASIS3Bucket.m in Sources */ = {isa = PBXBuildFile; fileRef = B5404000115114BA00D8BE63 /* ASIS3Bucket.m */; };
+ AD9C7082192DE0CB00B6416E /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FC210FF28CA001E145F /* ASIS3BucketObject.m */; };
+ AD9C7083192DE0CB00B6416E /* ASIS3BucketRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5404002115114BA00D8BE63 /* ASIS3BucketRequest.m */; };
+ AD9C7084192DE0CB00B6416E /* ASIS3ObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5404004115114BA00D8BE63 /* ASIS3ObjectRequest.m */; };
+ AD9C7085192DE0CB00B6416E /* ASIS3ServiceRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5404006115114BA00D8BE63 /* ASIS3ServiceRequest.m */; };
+ AD9C7086192DE0CB00B6416E /* ASIS3Request.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FC610FF28CA001E145F /* ASIS3Request.m */; };
+ AD9C7087192DE0CB00B6416E /* ASICloudFilesCDNRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FC910FF28CA001E145F /* ASICloudFilesCDNRequest.m */; };
+ AD9C7088192DE0CB00B6416E /* ASICloudFilesContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FCB10FF28CA001E145F /* ASICloudFilesContainer.m */; };
+ AD9C7089192DE0CB00B6416E /* ASICloudFilesContainerRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FCD10FF28CA001E145F /* ASICloudFilesContainerRequest.m */; };
+ AD9C708A192DE0CB00B6416E /* ASICloudFilesContainerXMLParserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FCF10FF28CA001E145F /* ASICloudFilesContainerXMLParserDelegate.m */; };
+ AD9C708B192DE0CB00B6416E /* ASICloudFilesObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD110FF28CA001E145F /* ASICloudFilesObject.m */; };
+ AD9C708C192DE0CB00B6416E /* ASICloudFilesObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD310FF28CA001E145F /* ASICloudFilesObjectRequest.m */; };
+ AD9C708D192DE0CB00B6416E /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD510FF28CA001E145F /* ASICloudFilesRequest.m */; };
+ AD9C7099192DE27A00B6416E /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C011C7CC970059B815 /* CFNetwork.framework */; };
+ AD9C709A192DE28700B6416E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C911C7CCA60059B815 /* SystemConfiguration.framework */; };
+ AD9C709B192DE29200B6416E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C611C7CC9F0059B815 /* MobileCoreServices.framework */; };
+ AD9C709C192DE29E00B6416E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4D011C7CCBC0059B815 /* CoreGraphics.framework */; };
+ AD9C70A0192DE43400B6416E /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9C709F192DE43400B6416E /* libxml2.dylib */; };
+ AD9C70A1192DE4DE00B6416E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9C709D192DE2B800B6416E /* libz.dylib */; };
B50C182C121C26FA0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C182B121C26FA0055FCAB /* Security.framework */; };
B50C1848121C27510055FCAB /* client.p12 in Resources */ = {isa = PBXBuildFile; fileRef = B50C1847121C27510055FCAB /* client.p12 */; };
B51791A31024C3E800583567 /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B51791A21024C3E800583567 /* AuthenticationViewController.m */; };
@@ -135,6 +207,15 @@
3F4C79A919206F9400AAF021 /* ASISCSRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASISCSRequestTests.h; sourceTree = ""; };
3F4C79AA19206F9400AAF021 /* ASISCSRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASISCSRequestTests.m; sourceTree = ""; };
3FAFBA87191B2C2100609F5B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "iPhone Sample/Resources/Default-568h@2x.png"; sourceTree = ""; };
+ AD9C704A192DDA5600B6416E /* ASIKit-iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ASIKit-iOS.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
+ AD9C704B192DDA5600B6416E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
+ AD9C704F192DDA5600B6416E /* ASIKit-iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ASIKit-iOS-Info.plist"; sourceTree = ""; };
+ AD9C7051192DDA5600B6416E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
+ AD9C7053192DDA5600B6416E /* ASIKit-iOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASIKit-iOS-Prefix.pch"; sourceTree = ""; };
+ AD9C7071192DDC0700B6416E /* ASIKit-iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASIKit-iOS.h"; sourceTree = ""; };
+ AD9C7097192DE19500B6416E /* libxml2.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.2.dylib; path = usr/lib/libxml2.2.dylib; sourceTree = SDKROOT; };
+ AD9C709D192DE2B800B6416E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
+ AD9C709F192DE43400B6416E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
B50C1821121C26DB0055FCAB /* ClientCertificateTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientCertificateTests.h; sourceTree = ""; };
B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientCertificateTests.m; sourceTree = ""; };
B50C182B121C26FA0055FCAB /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
@@ -279,6 +360,19 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AD9C7047192DDA5600B6416E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD9C70A1192DE4DE00B6416E /* libz.dylib in Frameworks */,
+ AD9C70A0192DE43400B6416E /* libxml2.dylib in Frameworks */,
+ AD9C709C192DE29E00B6416E /* CoreGraphics.framework in Frameworks */,
+ AD9C709B192DE29200B6416E /* MobileCoreServices.framework in Frameworks */,
+ AD9C709A192DE28700B6416E /* SystemConfiguration.framework in Frameworks */,
+ AD9C7099192DE27A00B6416E /* CFNetwork.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
B55B60C50F765BB00064029C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -351,6 +445,7 @@
1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */,
B55B60C70F765BB00064029C /* Tests.app */,
B576D72311C7F34D0059B815 /* ASIHTTPRequest iPad.app */,
+ AD9C704A192DDA5600B6416E /* ASIKit-iOS.framework */,
);
name = Products;
sourceTree = "";
@@ -362,6 +457,7 @@
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
+ AD9C704D192DDA5600B6416E /* ASIKit-iOS */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
@@ -415,6 +511,9 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ AD9C709F192DE43400B6416E /* libxml2.dylib */,
+ AD9C709D192DE2B800B6416E /* libz.dylib */,
+ AD9C7097192DE19500B6416E /* libxml2.2.dylib */,
B581DDC912FDFEEE003BA9D0 /* GHUnitIOS.framework */,
B576D4C011C7CC970059B815 /* CFNetwork.framework */,
B576D4D011C7CCBC0059B815 /* CoreGraphics.framework */,
@@ -425,6 +524,7 @@
B576D4C311C7CC9C0059B815 /* UIKit.framework */,
DADCEB9812D5057700958557 /* libxml2.dylib */,
DADCEB9E12D505AB00958557 /* libz.dylib */,
+ AD9C704B192DDA5600B6416E /* CoreFoundation.framework */,
);
name = Frameworks;
sourceTree = "";
@@ -464,6 +564,25 @@
name = Requests;
sourceTree = "";
};
+ AD9C704D192DDA5600B6416E /* ASIKit-iOS */ = {
+ isa = PBXGroup;
+ children = (
+ AD9C7071192DDC0700B6416E /* ASIKit-iOS.h */,
+ AD9C704E192DDA5600B6416E /* Supporting Files */,
+ );
+ path = "ASIKit-iOS";
+ sourceTree = "";
+ };
+ AD9C704E192DDA5600B6416E /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ AD9C704F192DDA5600B6416E /* ASIKit-iOS-Info.plist */,
+ AD9C7050192DDA5600B6416E /* InfoPlist.strings */,
+ AD9C7053192DDA5600B6416E /* ASIKit-iOS-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
B52329A911CA3380006C6E5A /* UI helpers */ = {
isa = PBXGroup;
children = (
@@ -573,6 +692,44 @@
};
/* End PBXGroup section */
+/* Begin PBXHeadersBuildPhase section */
+ AD9C7057192DDB3900B6416E /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD9C7058192DDB6D00B6416E /* Reachability.h in Headers */,
+ AD9C7059192DDB6D00B6416E /* ASIHTTPRequestConfig.h in Headers */,
+ AD9C705A192DDB6D00B6416E /* ASIHTTPRequestDelegate.h in Headers */,
+ AD9C705B192DDB6D00B6416E /* ASIAuthenticationDialog.h in Headers */,
+ AD9C705C192DDB6D00B6416E /* ASIInputStream.h in Headers */,
+ AD9C705D192DDB6D00B6416E /* ASIFormDataRequest.h in Headers */,
+ AD9C705E192DDB6D00B6416E /* ASIHTTPRequest.h in Headers */,
+ AD9C705F192DDB6D00B6416E /* ASINetworkQueue.h in Headers */,
+ AD9C7060192DDB6D00B6416E /* ASIDownloadCache.h in Headers */,
+ AD9C7061192DDB6D00B6416E /* ASIDataDecompressor.h in Headers */,
+ AD9C7062192DDB6D00B6416E /* ASIDataCompressor.h in Headers */,
+ AD9C7063192DDB6D00B6416E /* ASIWebPageRequest.h in Headers */,
+ AD9C7064192DDB6D00B6416E /* ASIS3Bucket.h in Headers */,
+ AD9C7065192DDB6D00B6416E /* ASIS3BucketObject.h in Headers */,
+ AD9C7066192DDB6D00B6416E /* ASIS3BucketRequest.h in Headers */,
+ AD9C7067192DDB6D00B6416E /* ASIS3ObjectRequest.h in Headers */,
+ AD9C7068192DDB6D00B6416E /* ASIS3ServiceRequest.h in Headers */,
+ AD9C7069192DDB6D00B6416E /* ASIS3Request.h in Headers */,
+ AD9C706A192DDB6D00B6416E /* ASICloudFilesCDNRequest.h in Headers */,
+ AD9C706B192DDB6D00B6416E /* ASICloudFilesContainer.h in Headers */,
+ AD9C706C192DDB6D00B6416E /* ASICloudFilesContainerRequest.h in Headers */,
+ AD9C706D192DDB6D00B6416E /* ASICloudFilesContainerXMLParserDelegate.h in Headers */,
+ AD9C706E192DDB6D00B6416E /* ASICloudFilesObject.h in Headers */,
+ AD9C706F192DDB6D00B6416E /* ASICloudFilesObjectRequest.h in Headers */,
+ AD9C7072192DDC0700B6416E /* ASIKit-iOS.h in Headers */,
+ AD9C7070192DDB6D00B6416E /* ASICloudFilesRequest.h in Headers */,
+ AD9C7073192DDFE400B6416E /* ASICacheDelegate.h in Headers */,
+ AD9C7074192DDFE400B6416E /* ASIProgressDelegate.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* iPhone */ = {
isa = PBXNativeTarget;
@@ -592,6 +749,24 @@
productReference = 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */;
productType = "com.apple.product-type.application";
};
+ AD9C7049192DDA5600B6416E /* ASIKit-iOS */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = AD9C7056192DDA5600B6416E /* Build configuration list for PBXNativeTarget "ASIKit-iOS" */;
+ buildPhases = (
+ AD9C7046192DDA5600B6416E /* Sources */,
+ AD9C7047192DDA5600B6416E /* Frameworks */,
+ AD9C7048192DDA5600B6416E /* Resources */,
+ AD9C7057192DDB3900B6416E /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "ASIKit-iOS";
+ productName = "ASIKit-iOS";
+ productReference = AD9C704A192DDA5600B6416E /* ASIKit-iOS.framework */;
+ productType = "com.apple.product-type.bundle";
+ };
B55B60C60F765BB00064029C /* Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = B55B60CE0F765BB10064029C /* Build configuration list for PBXNativeTarget "Tests" */;
@@ -646,6 +821,7 @@
Japanese,
French,
German,
+ en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* iPhone */;
projectDirPath = "";
@@ -654,6 +830,8 @@
1D6058900D05DD3D006BFB54 /* iPhone */,
B55B60C60F765BB00064029C /* Tests */,
B576D70211C7F34D0059B815 /* iPad */,
+ AD9C7049192DDA5600B6416E /* ASIKit-iOS */,
+ AD9C70AB192DFFCA00B6416E /* ASIKit */,
);
};
/* End PBXProject section */
@@ -670,6 +848,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AD9C7048192DDA5600B6416E /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD9C7052192DDA5600B6416E /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
B55B60C30F765BB00064029C /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -694,6 +880,19 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
+ AD9C70AF192DFFF300B6416E /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Sets the target folders and the final framework product.\nFMK_NAME=ASIKit\nFMK_VERSION=A\n\n# Install dir will be the final output to the framework.\n# The following line create it in the root folder of the current project.\nINSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework\n\n# Working dir will be deleted after the framework creation.\nWRK_DIR=build\nFMK_NAME_ORG=ASIKit-iOS\nDEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME_ORG}.framework\nSIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME_ORG}.framework\n\n# Building both architectures.\nxcodebuild ARCHS=\"armv7 armv7s\" ONLY_ACTIVE_ARCH=NO -project iPhone.xcodeproj -configuration \"Release\" -target \"${FMK_NAME_ORG}\" -sdk iphoneos\nxcodebuild -project iPhone.xcodeproj -configuration \"Release\" -target \"${FMK_NAME_ORG}\" -sdk iphonesimulator\n\n# Cleaning the oldest.\nif [ -d \"${INSTALL_DIR}\" ]\nthen\nrm -rf \"${INSTALL_DIR}\"\nfi\n\n# Creates and renews the final product folder.\nmkdir -p \"${INSTALL_DIR}\"\nmkdir -p \"${INSTALL_DIR}/Versions\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers\"\n\n# Creates the internal links.\n# It MUST uses relative path, otherwise will not work when the folder is copied/moved.\nln -s \"${FMK_VERSION}\" \"${INSTALL_DIR}/Versions/Current\"\nln -s \"Versions/Current/Headers\" \"${INSTALL_DIR}/Headers\"\nln -s \"Versions/Current/Resources\" \"${INSTALL_DIR}/Resources\"\nln -s \"Versions/Current/${FMK_NAME}\" \"${INSTALL_DIR}/${FMK_NAME}\"\n\n# Copies the headers and resources files to the final product folder.\ncp -R \"${DEVICE_DIR}/Headers/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers/\"\ncp -R \"${DEVICE_DIR}/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/\"\n\n# Removes the binary and header from the resources folder.\nrm -r \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Headers\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/${FMK_NAME_ORG}\"\n\n# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.\nlipo -create \"${DEVICE_DIR}/${FMK_NAME_ORG}\" \"${SIMULATOR_DIR}/${FMK_NAME_ORG}\" -output \"${INSTALL_DIR}/Versions/${FMK_VERSION}/${FMK_NAME}\"\n\nrm -r \"${WRK_DIR}\"\n\n\n";
+ };
B52D492410DA403A008E8365 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -765,6 +964,36 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AD9C7046192DDA5600B6416E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD9C7077192DE0CB00B6416E /* Reachability.m in Sources */,
+ AD9C7078192DE0CB00B6416E /* ASIAuthenticationDialog.m in Sources */,
+ AD9C7079192DE0CB00B6416E /* ASIInputStream.m in Sources */,
+ AD9C707A192DE0CB00B6416E /* ASIFormDataRequest.m in Sources */,
+ AD9C707B192DE0CB00B6416E /* ASIHTTPRequest.m in Sources */,
+ AD9C707C192DE0CB00B6416E /* ASINetworkQueue.m in Sources */,
+ AD9C707D192DE0CB00B6416E /* ASIDownloadCache.m in Sources */,
+ AD9C707E192DE0CB00B6416E /* ASIDataDecompressor.m in Sources */,
+ AD9C707F192DE0CB00B6416E /* ASIDataCompressor.m in Sources */,
+ AD9C7080192DE0CB00B6416E /* ASIWebPageRequest.m in Sources */,
+ AD9C7081192DE0CB00B6416E /* ASIS3Bucket.m in Sources */,
+ AD9C7082192DE0CB00B6416E /* ASIS3BucketObject.m in Sources */,
+ AD9C7083192DE0CB00B6416E /* ASIS3BucketRequest.m in Sources */,
+ AD9C7084192DE0CB00B6416E /* ASIS3ObjectRequest.m in Sources */,
+ AD9C7085192DE0CB00B6416E /* ASIS3ServiceRequest.m in Sources */,
+ AD9C7086192DE0CB00B6416E /* ASIS3Request.m in Sources */,
+ AD9C7087192DE0CB00B6416E /* ASICloudFilesCDNRequest.m in Sources */,
+ AD9C7088192DE0CB00B6416E /* ASICloudFilesContainer.m in Sources */,
+ AD9C7089192DE0CB00B6416E /* ASICloudFilesContainerRequest.m in Sources */,
+ AD9C708A192DE0CB00B6416E /* ASICloudFilesContainerXMLParserDelegate.m in Sources */,
+ AD9C708B192DE0CB00B6416E /* ASICloudFilesObject.m in Sources */,
+ AD9C708C192DE0CB00B6416E /* ASICloudFilesObjectRequest.m in Sources */,
+ AD9C708D192DE0CB00B6416E /* ASICloudFilesRequest.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
B55B60C40F765BB00064029C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -831,6 +1060,17 @@
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXVariantGroup section */
+ AD9C7050192DDA5600B6416E /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ AD9C7051192DDA5600B6416E /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
@@ -875,6 +1115,119 @@
};
name = Release;
};
+ AD9C7054192DDA5600B6416E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_OBJC_ARC = NO;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ASIKit-iOS/ASIKit-iOS-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "${SDK_DIR}/usr/include/libxml2",
+ );
+ INFOPLIST_FILE = "ASIKit-iOS/ASIKit-iOS-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ LINK_WITH_STANDARD_LIBRARIES = NO;
+ MACH_O_TYPE = mh_object;
+ MACOSX_DEPLOYMENT_TARGET = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ AD9C7055192DDA5600B6416E /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_OBJC_ARC = NO;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = YES;
+ DEAD_CODE_STRIPPING = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ASIKit-iOS/ASIKit-iOS-Prefix.pch";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "${SDK_DIR}/usr/include/libxml2",
+ );
+ INFOPLIST_FILE = "ASIKit-iOS/ASIKit-iOS-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ LINK_WITH_STANDARD_LIBRARIES = NO;
+ MACH_O_TYPE = mh_object;
+ MACOSX_DEPLOYMENT_TARGET = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ AD9C70AD192DFFCA00B6416E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ AD9C70AE192DFFCA00B6416E /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
B55B60CC0F765BB10064029C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
@@ -1011,6 +1364,24 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ AD9C7056192DDA5600B6416E /* Build configuration list for PBXNativeTarget "ASIKit-iOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AD9C7054192DDA5600B6416E /* Debug */,
+ AD9C7055192DDA5600B6416E /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ AD9C70AC192DFFCA00B6416E /* Build configuration list for PBXAggregateTarget "ASIKit" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AD9C70AD192DFFCA00B6416E /* Debug */,
+ AD9C70AE192DFFCA00B6416E /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
B55B60CE0F765BB10064029C /* Build configuration list for PBXNativeTarget "Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
From fb443c6b478354710dd25d167490d54bab3ed20b Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Fri, 23 May 2014 16:20:06 +0800
Subject: [PATCH 11/37] add readme
---
ASIKit-iOS/{ASIKit-iOS.h => ASIKit.h} | 2 +-
README.md | 164 +++++++++++++++++++++++---
iPhone.xcodeproj/project.pbxproj | 8 +-
3 files changed, 154 insertions(+), 20 deletions(-)
rename ASIKit-iOS/{ASIKit-iOS.h => ASIKit.h} (98%)
diff --git a/ASIKit-iOS/ASIKit-iOS.h b/ASIKit-iOS/ASIKit.h
similarity index 98%
rename from ASIKit-iOS/ASIKit-iOS.h
rename to ASIKit-iOS/ASIKit.h
index a7b51919..716b6e50 100644
--- a/ASIKit-iOS/ASIKit-iOS.h
+++ b/ASIKit-iOS/ASIKit.h
@@ -1,5 +1,5 @@
//
-// ASIKit-iOS.h
+// ASIKit.h
// iPhone
//
// Created by Littlebox222 on 14-5-22.
diff --git a/README.md b/README.md
index adb92a68..dd10614d 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,8 @@
ASI-SCS
=======
-Branch of ASIHTTPRequest for Sina Cloud Storage Service
-本SDK为ASIHTTPRequest的一个分支,熟悉ASI的同学可以轻松上手,不熟悉的也没关系,相信看完文档您一定能够运用自如,并且能够对ASI有一个初步的认识。
-> * 文档的详细内容请查阅:http://open.sinastorage.com/?c=doc&a=sdk
+本SDK为ASIHTTPRequest的一个分支,熟悉ASI的同学可以轻松上手,不熟悉的也没关系,相信看完文档您一定能够运用自如,并且能够对ASI有一个初步的了解。
+
> * SCS API 的详细内容请查阅:http://open.sinastorage.com/?c=doc&a=api
> * ASIHTTPRequest的详细内容请查阅:http://allseeing-i.com/ASIHTTPRequest/How-to-use
@@ -13,17 +12,57 @@ Branch of ASIHTTPRequest for Sina Cloud Storage Service
> * OSX: 10.8及以上。
####相关配置:
-> * 1、将SDK文件夹拷贝到你的工程目录下;
-> * 2、打开xcode,将SCSSDK.xcodeproj拖动到你的工程中;
-> * 3、选择你的工程,在右侧选择Build Settings,并设置Other Linker Flags 为 -ObjC -all_load;
-> * 4、选择Build Phases,在Link Binary With Libraries中添加如下:
-> * _iOS_:libSCSSDK_IOS.a;Foundation.framework ;CoreData.framework ;CoreFoundation.framework ;Security.framework ;CoreGraphics.framework ;UIKit.framework;
-> * _OSX_:libSCSSDK_OSX.a;Cocoa.framework ;CoreData.framework ;CoreFoundation.framework ;Security.framework ;AppKit.framework;
-> * 5、
+> * 1、下载ASIKit.Framework(你可以手动下载,链接如下;也可以执行步骤(1)—(4),写脚本由程序自动下载)
+>>Mac OS X:http://sdk.sinastorage.com/ASIKit.framework.zip
+>>iOS:http://sdk.sinastorage.com/ASIKit-iOS.framework.zip
+>> * (1)、打开工程,单击XCode侧边栏中的project行,并选择右侧的Build Phase;
+>> * (2)、选择项目的Target,在顶部菜单栏选择Editor > Add Build Phase > Add Run Script Build Phase;
+>> * (3)、设置Run Script(Mac OS X 与 iOS不同)如下;
+>> * (4)、Commond+B编译工程,会自动下载所需的ASIKit.Framework包到工程目录。
+
+> * 2、选择Link Binary With Libraries,点击“+”,点击“Add Other...”,到工程目录下选择添加ASIKit.Framework
+(或者将下载好的ASIKit.Framework直接拖到xcode工程里的Frameworks分组下,并在Add to targets里选中你所要关联的target)
+> * 3、在所需文件中添加头:ASIKit/ASIKit.h
+
+```shell
+# Run Script For Mac OS X
+
+# If not present, download ASIKit archive, extract it and cleanup.
+if [ ! -e $SRCROOT/ASIKit.framework ]; then
+ rm -rf $SRCROOT/ASIKit
+ mkdir $SRCROOT/ASIKit
+ cd $SRCROOT/ASIKit
+ echo "Downloading ASIKit framework"
+ curl -s -O http://sdk.sinastorage.com/ASIKit.framework.zip
+ echo "Unzipping ASIKit"
+ unzip ASIKit.framework.zip
+ mv ASIKit.framework $SRCROOT
+ rm -rf $SRCROOT/ASIKit
+ echo "ASIKit installed for build"
+fi
+```
+
+```shell
+# Run Script For iOS
+
+# If not present, download ASIKit archive, extract it and cleanup.
+ if [ ! -e $SRCROOT/ASIKit.framework ]; then
+ rm -rf $SRCROOT/ASIKit
+ mkdir $SRCROOT/ASIKit
+ cd $SRCROOT/ASIKit
+ echo "Downloading ASIKit-iOS framework"
+ curl -s -O http://sdk.sinastorage.com/ASIKit-iOS.framework.zip
+ echo "Unzipping ASIKit-iOS"
+ unzip ASIKit-iOS.framework.zip
+ mv ASIKit.framework $SRCROOT
+ rm -rf $SRCROOT/ASIKit
+ echo "ASIKit installed for build"
+fi
+```
###快速上手
> * 以下示例为简单明确的介绍SDK使用方法,均采用同步请求方式。
-关于请求队列以及异步请求的详细介绍,请参考:【使用队列及异步请求】
+关于请求队列以及异步请求的详细介绍,请参考:【使用异步请求及队列】
####Bucket操作
#####列取bucket
@@ -39,7 +78,9 @@ if (![request error]) {
```
#####创建bucket
+
> * 为每个请求设置相应的accessKey和secretAccessKey是很繁琐的,因此我们可以设置基类(ASIS3Request)的sharedAccessKey和sharedSecretAccessKey。这样下次再发送某一请求时,无需再次设置相应的key,SDK会调用我们设置好的这两个sharedKey。
+
```objective-c
[ASIS3Request setSharedSecretAccessKey:@"YourSecretAccessKey"];
[ASIS3Request setSharedAccessKey:@"YourAccessKey"];
@@ -53,6 +94,7 @@ if ([request error]) {
```
#####删除bucket
+
> * 这里我们无需再次设置相应的accesskey,前面我们已经设置好了两个sharedKey。
```objective-c
@@ -146,13 +188,25 @@ ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath wit
[request requestScheme:ASIS3RequestSchemeHTTPS];
```
-####使用GZIP压缩
+####使用异步请求及队列
+#####异步请求的使用
```objective-c
-ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath withBucket:@"my-bucket" key:@"path/to/the/object"];
-[request setShouldCompressRequestBody:YES];
+- (void)listRequest {
+ ASIS3BucketRequest *listRequest = [ASIS3BucketRequest requestWithBucket:@"my-bucket"];
+ [listRequest setDelegate:self];//delegate:ASIHTTPRequestDelegate
+ [listRequest startAsynchronous];
+}
+
+- (void)requestFinished:(ASIHTTPRequest *)request {
+ NSString *responseString = [request responseString];
+ NSData *responseData = [request responseData];
+}
+
+- (void)requestFailed:(ASIHTTPRequest *)request {
+ NSError *error = [request error];
+}
```
-####使用队列及异步请求
#####创建队列
```objective-c
//ASINetworkQueue *queue;
@@ -161,7 +215,9 @@ ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath wit
```
#####设置队列回调
+
> * 其中selector可自定义。
+
```objective-c
//请求成功
[[self queue] setRequestDidFinishSelector:@selector(requestDone:)];
@@ -207,7 +263,9 @@ ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath wit
```
#####example
+
> * 本示例较为完整的展示了如何使用队列及异步请求获取object列表并下载。
+
```objective-c
- (void)download25ImagesToDisk {
@@ -220,8 +278,12 @@ ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath wit
[listRequest setPrefix:@"images/jpegs"];
[listRequest setMaxResultCount:25];
[listRequest setDelegate:self];
+
+ //设置回调
[listRequest setDidFinishSelector:@selector(finishedDownloadingImageList:)];
[listRequest setDidFailSelector:@selector(failedDownloadingImageList:)];
+
+ //加入队列
[[self queue] addOperation:listRequest];
}
@@ -258,4 +320,76 @@ ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath wit
- (void)requestFailed:(ASIS3Request *)request {
NSLog(@"Download error: %@",[[request error] localizedDescription]);
}
+```
+
+####进度跟踪
+
+> * 对于单个请求,可通过设置delegate获取进度信息;
+> * 对于请求队列,可通过设置队列的delegate获取全部请求的进度信息;
+> * 两者可同时获得;
+> * 可通过设置showAccurateProgress == YES来获取精确进度;
+> * 详情请参考:http://allseeing-i.com/ASIHTTPRequest/How-to-use#tracking_progress
+
+#####上传进度(单个请求)
+```objective-c
+//myProgressIndicator is a UIProgressView for iOS
+//myProgressIndicator is a NSProgressIndicator for OS X
+
+ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
+[request setUploadProgressDelegate:myProgressIndicator];
+[request startSynchronous];
+NSLog(@"Max: %f, Value: %f", [myProgressIndicator maxValue],[myProgressIndicator doubleValue]);
+```
+
+#####上传进度(队列)
+```objective-c
+- (void)uploadSomethingFiveTimes:(NSURL *)url
+{
+ [myQueue cancelAllOperations];
+ [myQueue setUploadProgressDelegate:myProgressIndicator];
+ [myQueue setDelegate:self];
+ [myQueue setRequestDidFinishSelector:@selector(queueComplete:)];
+ int i;
+ for (i=0; i<5; i++) {
+ ASIHTTPRequest *request = [ASIFormDataRequest requestWithURL:url];
+ [request setPostBody:[@"Some data" dataUsingEncoding:NSUTF8StringEncoding]];
+ [myQueue addOperation:request];
+ }
+ [myQueue go];
+}
+
+- (void)queueComplete:(ASINetworkQueue *)queue
+{
+ NSLog(@"Max: %f, Value: %f", [myProgressIndicator maxValue],[myProgressIndicator doubleValue]);
+}
+```
+
+#####下载进度(单个请求)
+```objective-c
+ ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
+[request setDownloadProgressDelegate:myProgressIndicator];
+[request startSynchronous];
+NSLog(@"Max: %f, Value: %f", [myProgressIndicator maxValue],[myProgressIndicator doubleValue]);
+```
+
+#####下载进度(队列)
+```objective-c
+- (void)fetchThisURLFiveTimes:(NSURL *)url
+{
+ [myQueue cancelAllOperations];
+ [myQueue setDownloadProgressDelegate:myProgressIndicator];
+ [myQueue setDelegate:self];
+ [myQueue setRequestDidFinishSelector:@selector(queueComplete:)];
+ int i;
+ for (i=0; i<5; i++) {
+ ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
+ [myQueue addOperation:request];
+ }
+ [myQueue go];
+}
+
+- (void)queueComplete:(ASINetworkQueue *)queue
+{
+ NSLog(@"Value: %f", [myProgressIndicator progress]);
+}
```
\ No newline at end of file
diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj
index ba9c72bd..d83fc850 100644
--- a/iPhone.xcodeproj/project.pbxproj
+++ b/iPhone.xcodeproj/project.pbxproj
@@ -50,7 +50,7 @@
AD9C706E192DDB6D00B6416E /* ASICloudFilesObject.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FD010FF28CA001E145F /* ASICloudFilesObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
AD9C706F192DDB6D00B6416E /* ASICloudFilesObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FD210FF28CA001E145F /* ASICloudFilesObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
AD9C7070192DDB6D00B6416E /* ASICloudFilesRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B5873FD410FF28CA001E145F /* ASICloudFilesRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
- AD9C7072192DDC0700B6416E /* ASIKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9C7071192DDC0700B6416E /* ASIKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AD9C7072192DDC0700B6416E /* ASIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9C7071192DDC0700B6416E /* ASIKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
AD9C7073192DDFE400B6416E /* ASICacheDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5FE752A11DBBA6A00F898C8 /* ASICacheDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
AD9C7074192DDFE400B6416E /* ASIProgressDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B5747F281174BB8300C9414E /* ASIProgressDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
AD9C7077192DE0CB00B6416E /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = B55252B311D22E2200F9B170 /* Reachability.m */; };
@@ -212,7 +212,7 @@
AD9C704F192DDA5600B6416E /* ASIKit-iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ASIKit-iOS-Info.plist"; sourceTree = ""; };
AD9C7051192DDA5600B6416E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
AD9C7053192DDA5600B6416E /* ASIKit-iOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASIKit-iOS-Prefix.pch"; sourceTree = ""; };
- AD9C7071192DDC0700B6416E /* ASIKit-iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASIKit-iOS.h"; sourceTree = ""; };
+ AD9C7071192DDC0700B6416E /* ASIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIKit.h; sourceTree = ""; };
AD9C7097192DE19500B6416E /* libxml2.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.2.dylib; path = usr/lib/libxml2.2.dylib; sourceTree = SDKROOT; };
AD9C709D192DE2B800B6416E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
AD9C709F192DE43400B6416E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
@@ -567,7 +567,7 @@
AD9C704D192DDA5600B6416E /* ASIKit-iOS */ = {
isa = PBXGroup;
children = (
- AD9C7071192DDC0700B6416E /* ASIKit-iOS.h */,
+ AD9C7071192DDC0700B6416E /* ASIKit.h */,
AD9C704E192DDA5600B6416E /* Supporting Files */,
);
path = "ASIKit-iOS";
@@ -721,7 +721,7 @@
AD9C706D192DDB6D00B6416E /* ASICloudFilesContainerXMLParserDelegate.h in Headers */,
AD9C706E192DDB6D00B6416E /* ASICloudFilesObject.h in Headers */,
AD9C706F192DDB6D00B6416E /* ASICloudFilesObjectRequest.h in Headers */,
- AD9C7072192DDC0700B6416E /* ASIKit-iOS.h in Headers */,
+ AD9C7072192DDC0700B6416E /* ASIKit.h in Headers */,
AD9C7070192DDB6D00B6416E /* ASICloudFilesRequest.h in Headers */,
AD9C7073192DDFE400B6416E /* ASICacheDelegate.h in Headers */,
AD9C7074192DDFE400B6416E /* ASIProgressDelegate.h in Headers */,
From 81da4708269df01cfbcb7451b0ee325d3c36a628 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Mon, 26 May 2014 10:48:57 +0800
Subject: [PATCH 12/37] update readme
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index dd10614d..c8dda1f0 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,8 @@ ASI-SCS
> * 2、选择Link Binary With Libraries,点击“+”,点击“Add Other...”,到工程目录下选择添加ASIKit.Framework
(或者将下载好的ASIKit.Framework直接拖到xcode工程里的Frameworks分组下,并在Add to targets里选中你所要关联的target)
-> * 3、在所需文件中添加头:ASIKit/ASIKit.h
+> * 3、(对于iOS工程)选择Link Binary With Libraries,点击“+”,添加库:libxml2.dylib,libz.dylib,SystemConfiguration.framework,MobileCoreServices.framework,CFNetwork.framework
+> * 4、在所需文件中添加头:ASIKit/ASIKit.h
```shell
# Run Script For Mac OS X
From 9e56f36f555ba7ea116f687b3d702cda5243f19f Mon Sep 17 00:00:00 2001
From: Bruce Chen <662005@qq.com>
Date: Mon, 26 May 2014 16:22:58 +0800
Subject: [PATCH 13/37] update
---
Classes/ASIHTTPRequest.m | 2 +-
Classes/Tests/ASISCSRequestTests.m | 38 ++++++++++++++++--------------
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m
index d99c54cb..c4f4f5a7 100644
--- a/Classes/ASIHTTPRequest.m
+++ b/Classes/ASIHTTPRequest.m
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
-NSString *ASIHTTPRequestVersion = @"v1.8.2-14 2014-05-12";
+NSString *ASIHTTPRequestVersion = @"v1.8.2-15 2014-05-20";
static NSString *defaultUserAgent = nil;
diff --git a/Classes/Tests/ASISCSRequestTests.m b/Classes/Tests/ASISCSRequestTests.m
index efd1e621..e72b56c3 100644
--- a/Classes/Tests/ASISCSRequestTests.m
+++ b/Classes/Tests/ASISCSRequestTests.m
@@ -18,7 +18,7 @@
static NSString *secretAccessKey = @"";
// You should run these tests on a bucket that does not yet exist
-static NSString *bucket = @"";
+static NSString *bucket = @"test-009";
@@ -143,7 +143,7 @@ - (void)testFailure
- (void)createTestBucket
{
- return;
+ //return;
/*
if (!bucket) {
@@ -157,25 +157,26 @@ - (void)createTestBucket
[bucketRequest setSecretAccessKey:secretAccessKey];
[bucketRequest setAccessKey:accessKey];
[bucketRequest startSynchronous];
+ [self logRequest:bucketRequest];
GHAssertNil([bucketRequest error], @"Failed to create a bucket");
}
// To run this test, uncomment and fill in your S3 access details
- (void)testREST
{
- [self createTestBucket];
+ //[self createTestBucket];
BOOL success = (![secretAccessKey isEqualToString:@""] && ![accessKey isEqualToString:@""] && ![bucket isEqualToString:@""]);
GHAssertTrue(success, @"You need to supply your S3 access details to run the REST test (see the top of ASIS3RequestTests.m)");
// Test creating a bucket
- /*
+
ASIS3BucketRequest *bucketRequest = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
[bucketRequest setSecretAccessKey:secretAccessKey];
[bucketRequest setAccessKey:accessKey];
[bucketRequest startSynchronous];
GHAssertNil([bucketRequest error],@"Failed to create a bucket");
- */
+
// List buckets to make sure the bucket is there
ASIS3ServiceRequest *serviceRequest = [ASIS3ServiceRequest serviceRequest];
@@ -324,13 +325,12 @@ - (void)testREST
GHAssertTrue(success,@"Failed to DELETE the file from S3");
// Delete the bucket
- /*
+
bucketRequest = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
[bucketRequest setSecretAccessKey:secretAccessKey];
[bucketRequest setAccessKey:accessKey];
[bucketRequest startSynchronous];
GHAssertNil([bucketRequest error],@"Failed to delete a bucket");
- */
}
@@ -730,15 +730,15 @@ - (void)testHTTPS
[ASIS3Request setSharedSecretAccessKey:secretAccessKey];
// Create a bucket
- /*
+
ASIS3Request *request = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
[request setValidatesSecureCertificate:NO];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to create a bucket");
- */
- ASIS3Request *request;
+
+ //ASIS3Request *request;
// PUT something in it
NSString *key = @"king";
@@ -763,13 +763,15 @@ - (void)testHTTPS
GHAssertTrue(success,@"Failed to DELETE the object from S3");
// Delete the bucket
- /*
+
request = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to delete a bucket");
- */
+ //sleep(1);
+
+
[ASIS3Request setSharedAccessKey:nil];
[ASIS3Request setSharedSecretAccessKey:nil];
}
@@ -781,14 +783,14 @@ - (void)testCannedACLs
[ASIS3Request setSharedSecretAccessKey:secretAccessKey];
// Create a bucket
- /*
+
ASIS3Request *request = [ASIS3BucketRequest PUTRequestWithBucket:bucket];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to create a bucket");
- */
- ASIS3Request *request;
+
+ //ASIS3Request *request;
NSArray *ACLs = [NSArray arrayWithObjects:ASIS3AccessPolicyPrivate, ASIS3AccessPolicyPublicRead, ASIS3AccessPolicyPublicReadWrite, ASIS3AccessPolicyAuthenticatedRead, nil];
@@ -801,7 +803,7 @@ - (void)testCannedACLs
[self logRequest:request];
GHAssertNil([request error],@"Failed to PUT some data into S3");
- sleep(1);
+ //sleep(1);
// GET object ACL
request = [ASIS3ObjectRequest requestWithBucket:bucket key:key subResource:@"acl"];
@@ -818,12 +820,12 @@ - (void)testCannedACLs
GHAssertTrue(success,@"Failed to DELETE the object from S3");
// Delete the bucket
- /*
+
request = [ASIS3BucketRequest DELETERequestWithBucket:bucket];
[request setRequestScheme:ASIS3RequestSchemeHTTPS];
[request startSynchronous];
GHAssertNil([request error],@"Failed to delete a bucket");
- */
+
[ASIS3Request setSharedAccessKey:nil];
[ASIS3Request setSharedSecretAccessKey:nil];
From 1e0bf49be89665ff67b2d73b7a06de2a0902ac95 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Wed, 28 May 2014 15:18:40 +0800
Subject: [PATCH 14/37] update
---
ASIKit-iOS/ASIKit-iOS-Info.plist | 44 --------------------------------
iPhone.xcodeproj/project.pbxproj | 28 +++++++-------------
2 files changed, 9 insertions(+), 63 deletions(-)
delete mode 100644 ASIKit-iOS/ASIKit-iOS-Info.plist
diff --git a/ASIKit-iOS/ASIKit-iOS-Info.plist b/ASIKit-iOS/ASIKit-iOS-Info.plist
deleted file mode 100644
index 68dabaf2..00000000
--- a/ASIKit-iOS/ASIKit-iOS-Info.plist
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- English
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIconFile
-
- CFBundleIdentifier
- com.sina.${PRODUCT_NAME:rfc1034identifier}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1
- CFPlugInDynamicRegisterFunction
-
- CFPlugInDynamicRegistration
- NO
- CFPlugInFactories
-
- 00000000-0000-0000-0000-000000000000
- MyFactoryFunction
-
- CFPlugInTypes
-
- 00000000-0000-0000-0000-000000000000
-
- 00000000-0000-0000-0000-000000000000
-
-
- CFPlugInUnloadFunction
-
-
-
diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj
index d83fc850..5c977b2f 100644
--- a/iPhone.xcodeproj/project.pbxproj
+++ b/iPhone.xcodeproj/project.pbxproj
@@ -76,12 +76,6 @@
AD9C708B192DE0CB00B6416E /* ASICloudFilesObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD110FF28CA001E145F /* ASICloudFilesObject.m */; };
AD9C708C192DE0CB00B6416E /* ASICloudFilesObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD310FF28CA001E145F /* ASICloudFilesObjectRequest.m */; };
AD9C708D192DE0CB00B6416E /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FD510FF28CA001E145F /* ASICloudFilesRequest.m */; };
- AD9C7099192DE27A00B6416E /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C011C7CC970059B815 /* CFNetwork.framework */; };
- AD9C709A192DE28700B6416E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C911C7CCA60059B815 /* SystemConfiguration.framework */; };
- AD9C709B192DE29200B6416E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4C611C7CC9F0059B815 /* MobileCoreServices.framework */; };
- AD9C709C192DE29E00B6416E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D4D011C7CCBC0059B815 /* CoreGraphics.framework */; };
- AD9C70A0192DE43400B6416E /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9C709F192DE43400B6416E /* libxml2.dylib */; };
- AD9C70A1192DE4DE00B6416E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9C709D192DE2B800B6416E /* libz.dylib */; };
B50C182C121C26FA0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C182B121C26FA0055FCAB /* Security.framework */; };
B50C1848121C27510055FCAB /* client.p12 in Resources */ = {isa = PBXBuildFile; fileRef = B50C1847121C27510055FCAB /* client.p12 */; };
B51791A31024C3E800583567 /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B51791A21024C3E800583567 /* AuthenticationViewController.m */; };
@@ -213,9 +207,6 @@
AD9C7051192DDA5600B6416E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
AD9C7053192DDA5600B6416E /* ASIKit-iOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASIKit-iOS-Prefix.pch"; sourceTree = ""; };
AD9C7071192DDC0700B6416E /* ASIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIKit.h; sourceTree = ""; };
- AD9C7097192DE19500B6416E /* libxml2.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.2.dylib; path = usr/lib/libxml2.2.dylib; sourceTree = SDKROOT; };
- AD9C709D192DE2B800B6416E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
- AD9C709F192DE43400B6416E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
B50C1821121C26DB0055FCAB /* ClientCertificateTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientCertificateTests.h; sourceTree = ""; };
B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientCertificateTests.m; sourceTree = ""; };
B50C182B121C26FA0055FCAB /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
@@ -364,12 +355,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- AD9C70A1192DE4DE00B6416E /* libz.dylib in Frameworks */,
- AD9C70A0192DE43400B6416E /* libxml2.dylib in Frameworks */,
- AD9C709C192DE29E00B6416E /* CoreGraphics.framework in Frameworks */,
- AD9C709B192DE29200B6416E /* MobileCoreServices.framework in Frameworks */,
- AD9C709A192DE28700B6416E /* SystemConfiguration.framework in Frameworks */,
- AD9C7099192DE27A00B6416E /* CFNetwork.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -511,9 +496,6 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
- AD9C709F192DE43400B6416E /* libxml2.dylib */,
- AD9C709D192DE2B800B6416E /* libz.dylib */,
- AD9C7097192DE19500B6416E /* libxml2.2.dylib */,
B581DDC912FDFEEE003BA9D0 /* GHUnitIOS.framework */,
B576D4C011C7CC970059B815 /* CFNetwork.framework */,
B576D4D011C7CCBC0059B815 /* CoreGraphics.framework */,
@@ -891,7 +873,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Sets the target folders and the final framework product.\nFMK_NAME=ASIKit\nFMK_VERSION=A\n\n# Install dir will be the final output to the framework.\n# The following line create it in the root folder of the current project.\nINSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework\n\n# Working dir will be deleted after the framework creation.\nWRK_DIR=build\nFMK_NAME_ORG=ASIKit-iOS\nDEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME_ORG}.framework\nSIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME_ORG}.framework\n\n# Building both architectures.\nxcodebuild ARCHS=\"armv7 armv7s\" ONLY_ACTIVE_ARCH=NO -project iPhone.xcodeproj -configuration \"Release\" -target \"${FMK_NAME_ORG}\" -sdk iphoneos\nxcodebuild -project iPhone.xcodeproj -configuration \"Release\" -target \"${FMK_NAME_ORG}\" -sdk iphonesimulator\n\n# Cleaning the oldest.\nif [ -d \"${INSTALL_DIR}\" ]\nthen\nrm -rf \"${INSTALL_DIR}\"\nfi\n\n# Creates and renews the final product folder.\nmkdir -p \"${INSTALL_DIR}\"\nmkdir -p \"${INSTALL_DIR}/Versions\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers\"\n\n# Creates the internal links.\n# It MUST uses relative path, otherwise will not work when the folder is copied/moved.\nln -s \"${FMK_VERSION}\" \"${INSTALL_DIR}/Versions/Current\"\nln -s \"Versions/Current/Headers\" \"${INSTALL_DIR}/Headers\"\nln -s \"Versions/Current/Resources\" \"${INSTALL_DIR}/Resources\"\nln -s \"Versions/Current/${FMK_NAME}\" \"${INSTALL_DIR}/${FMK_NAME}\"\n\n# Copies the headers and resources files to the final product folder.\ncp -R \"${DEVICE_DIR}/Headers/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers/\"\ncp -R \"${DEVICE_DIR}/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/\"\n\n# Removes the binary and header from the resources folder.\nrm -r \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Headers\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/${FMK_NAME_ORG}\"\n\n# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.\nlipo -create \"${DEVICE_DIR}/${FMK_NAME_ORG}\" \"${SIMULATOR_DIR}/${FMK_NAME_ORG}\" -output \"${INSTALL_DIR}/Versions/${FMK_VERSION}/${FMK_NAME}\"\n\nrm -r \"${WRK_DIR}\"\n\n\n";
+ shellScript = "# Sets the target folders and the final framework product.\nFMK_NAME=ASIKit\nFMK_VERSION=A\n\n# Install dir will be the final output to the framework.\n# The following line create it in the root folder of the current project.\nINSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework\n\n# Working dir will be deleted after the framework creation.\nWRK_DIR=build\nFMK_NAME_ORG=ASIKit-iOS\nDEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME_ORG}.framework\nSIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME_ORG}.framework\n\n# Building both architectures.\nxcodebuild ONLY_ACTIVE_ARCH=NO -project iPhone.xcodeproj -configuration \"Release\" -target \"${FMK_NAME_ORG}\" -sdk iphoneos\nxcodebuild ONLY_ACTIVE_ARCH=NO -project iPhone.xcodeproj -configuration \"Release\" -target \"${FMK_NAME_ORG}\" -sdk iphonesimulator\n\n# Cleaning the oldest.\nif [ -d \"${INSTALL_DIR}\" ]\nthen\nrm -rf \"${INSTALL_DIR}\"\nfi\n\n# Creates and renews the final product folder.\nmkdir -p \"${INSTALL_DIR}\"\nmkdir -p \"${INSTALL_DIR}/Versions\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers\"\n\n# Creates the internal links.\n# It MUST uses relative path, otherwise will not work when the folder is copied/moved.\nln -s \"${FMK_VERSION}\" \"${INSTALL_DIR}/Versions/Current\"\nln -s \"Versions/Current/Headers\" \"${INSTALL_DIR}/Headers\"\nln -s \"Versions/Current/Resources\" \"${INSTALL_DIR}/Resources\"\nln -s \"Versions/Current/${FMK_NAME}\" \"${INSTALL_DIR}/${FMK_NAME}\"\n\n# Copies the headers and resources files to the final product folder.\ncp -R \"${DEVICE_DIR}/Headers/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers/\"\ncp -R \"${DEVICE_DIR}/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/\"\n\n# Removes the binary and header from the resources folder.\nrm -r \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Headers\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/${FMK_NAME_ORG}\"\n\n# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.\nlipo -create \"${DEVICE_DIR}/${FMK_NAME_ORG}\" \"${SIMULATOR_DIR}/${FMK_NAME_ORG}\" -output \"${INSTALL_DIR}/Versions/${FMK_VERSION}/${FMK_NAME}\"\n\nrm -r \"${WRK_DIR}\"\n\n\n";
};
B52D492410DA403A008E8365 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -1136,6 +1118,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ASIKit-iOS/ASIKit-iOS-Prefix.pch";
@@ -1189,6 +1172,7 @@
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ASIKit-iOS/ASIKit-iOS-Prefix.pch";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -1217,14 +1201,18 @@
AD9C70AD192DFFCA00B6416E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
AD9C70AE192DFFCA00B6416E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
@@ -1334,6 +1322,7 @@
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -1346,6 +1335,7 @@
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
From 4059061c502311c4876d05f83005f5576aeb2f42 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Wed, 28 May 2014 15:25:37 +0800
Subject: [PATCH 15/37] update read me
---
ASIKit-iOS/ASIKit-iOS-Info.plist | 46 ++++++++++++++++++++++++++++++++
README.md | 2 +-
2 files changed, 47 insertions(+), 1 deletion(-)
create mode 100644 ASIKit-iOS/ASIKit-iOS-Info.plist
diff --git a/ASIKit-iOS/ASIKit-iOS-Info.plist b/ASIKit-iOS/ASIKit-iOS-Info.plist
new file mode 100644
index 00000000..d728ff78
--- /dev/null
+++ b/ASIKit-iOS/ASIKit-iOS-Info.plist
@@ -0,0 +1,46 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ com.sina.${PRODUCT_NAME:rfc1034identifier}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+ CFPlugInDynamicRegisterFunction
+
+ CFPlugInDynamicRegistration
+ NO
+ CFPlugInFactories
+
+ 00000000-0000-0000-0000-000000000000
+ MyFactoryFunction
+
+ CFPlugInTypes
+
+ 00000000-0000-0000-0000-000000000000
+
+ 00000000-0000-0000-0000-000000000000
+
+
+ CFPlugInUnloadFunction
+
+
+
+
+
diff --git a/README.md b/README.md
index c8dda1f0..9bac2669 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ ASI-SCS
> * 2、选择Link Binary With Libraries,点击“+”,点击“Add Other...”,到工程目录下选择添加ASIKit.Framework
(或者将下载好的ASIKit.Framework直接拖到xcode工程里的Frameworks分组下,并在Add to targets里选中你所要关联的target)
-> * 3、(对于iOS工程)选择Link Binary With Libraries,点击“+”,添加库:libxml2.dylib,libz.dylib,SystemConfiguration.framework,MobileCoreServices.framework,CFNetwork.framework
+> * 3、(对于iOS工程)选择Link Binary With Libraries,点击“+”,添加库:libxml2.dylib,libz.dylib,SystemConfiguration.framework,MobileCoreServices.framework,CFNetwork.framework,CoreGraphics.framework,Foundation.framework,UIKit.framework,CoreFoundation.framework
> * 4、在所需文件中添加头:ASIKit/ASIKit.h
```shell
From 9226a4482f7b5a45a78717fd570d0da83f81f653 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Tue, 10 Jun 2014 18:04:04 +0800
Subject: [PATCH 16/37] add requestForNextChunk
---
Classes/S3/ASIS3BucketRequest.h | 3 +++
Classes/S3/ASIS3BucketRequest.m | 28 ++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/Classes/S3/ASIS3BucketRequest.h b/Classes/S3/ASIS3BucketRequest.h
index 70d67bc0..8688f795 100644
--- a/Classes/S3/ASIS3BucketRequest.h
+++ b/Classes/S3/ASIS3BucketRequest.h
@@ -60,10 +60,13 @@
// Use for deleting buckets - they must be empty for this to succeed
+ (id)DELETERequestWithBucket:(NSString *)bucket;
+- (id)requestForNextChunk;
+
@property (retain, nonatomic) NSString *bucket;
@property (retain, nonatomic) NSString *subResource;
@property (retain, nonatomic) NSString *prefix;
@property (retain, nonatomic) NSString *marker;
+@property (retain, nonatomic) NSString *nextMarker;
@property (assign, nonatomic) int maxResultCount;
@property (retain, nonatomic) NSString *delimiter;
@property (retain, readonly) NSMutableArray *objects;
diff --git a/Classes/S3/ASIS3BucketRequest.m b/Classes/S3/ASIS3BucketRequest.m
index 9a6b1b5a..6018fec0 100644
--- a/Classes/S3/ASIS3BucketRequest.m
+++ b/Classes/S3/ASIS3BucketRequest.m
@@ -43,6 +43,28 @@ + (id)requestWithBucket:(NSString *)theBucket subResource:(NSString *)theSubReso
return request;
}
+- (id)requestForNextChunk {
+
+ if (![self isTruncated]) {
+ return nil;
+ }
+
+ if (![self nextMarker]) {
+ return nil;
+ }
+
+ ASIS3BucketRequest *listRequest = [[[ASIS3BucketRequest alloc] initWithURL:nil] autorelease];
+
+ [listRequest setBucket:[self bucket]];
+ [listRequest setSubResource:[self subResource]];
+ [listRequest setPrefix:[self prefix]];
+ [listRequest setMaxResultCount:[self maxResultCount]];
+ [listRequest setDelimiter:[self delimiter]];
+ [listRequest setMarker:[self nextMarker]];
+
+ return listRequest;
+}
+
+ (id)PUTRequestWithBucket:(NSString *)theBucket
{
ASIS3BucketRequest *request = [self requestWithBucket:theBucket];
@@ -142,6 +164,10 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
[[self commonPrefixes] addObject:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"IsTruncated"]) {
[self setIsTruncated:[[self currentXMLElementContent] isEqualToString:@"True"]];
+ } else if ([elementName isEqualToString:@"Marker"]) {
+ [self setMarker:[self currentXMLElementContent]];
+ } else if ([elementName isEqualToString:@"NextMarker"]) {
+ [self setNextMarker:[self currentXMLElementContent]];
} else {
// Let ASIS3Request look for error messages
[super parser:parser didEndElement:elementName namespaceURI:namespaceURI qualifiedName:qName];
@@ -157,6 +183,7 @@ - (id)copyWithZone:(NSZone *)zone
[newRequest setSubResource:[self subResource]];
[newRequest setPrefix:[self prefix]];
[newRequest setMarker:[self marker]];
+ [newRequest setNextMarker:[self nextMarker]];
[newRequest setMaxResultCount:[self maxResultCount]];
[newRequest setDelimiter:[self delimiter]];
return newRequest;
@@ -169,6 +196,7 @@ - (id)copyWithZone:(NSZone *)zone
@synthesize commonPrefixes;
@synthesize prefix;
@synthesize marker;
+@synthesize nextMarker;
@synthesize maxResultCount;
@synthesize delimiter;
@synthesize isTruncated;
From a49d37dfd558a9ddaca270942139ce77978a59eb Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Fri, 27 Jun 2014 14:51:32 +0800
Subject: [PATCH 17/37] update for ASIS3Bucket property
---
Classes/S3/ASIS3Bucket.h | 3 +++
Classes/S3/ASIS3Bucket.m | 3 ++-
Classes/S3/ASIS3ServiceRequest.m | 5 ++++-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Classes/S3/ASIS3Bucket.h b/Classes/S3/ASIS3Bucket.h
index 70e97cdf..98309595 100644
--- a/Classes/S3/ASIS3Bucket.h
+++ b/Classes/S3/ASIS3Bucket.h
@@ -23,6 +23,8 @@
// Information about the owner of this bucket
NSString *ownerID;
NSString *ownerName;
+
+ unsigned long long consumedBytes;
}
+ (id)bucketWithOwnerID:(NSString *)ownerID ownerName:(NSString *)ownerName;
@@ -31,4 +33,5 @@
@property (retain) NSDate *creationDate;
@property (retain) NSString *ownerID;
@property (retain) NSString *ownerName;
+@property (assign) unsigned long long consumedBytes;
@end
diff --git a/Classes/S3/ASIS3Bucket.m b/Classes/S3/ASIS3Bucket.m
index eab6194c..1c1ffdab 100644
--- a/Classes/S3/ASIS3Bucket.m
+++ b/Classes/S3/ASIS3Bucket.m
@@ -30,11 +30,12 @@ - (void)dealloc
- (NSString *)description
{
- return [NSString stringWithFormat:@"Name: %@ creationDate: %@ ownerID: %@ ownerName: %@",[self name],[self creationDate],[self ownerID],[self ownerName]];
+ return [NSString stringWithFormat:@"Name: %@ creationDate: %@ ownerID: %@ ownerName: %@ consumedBytes: %llu",[self name],[self creationDate],[self ownerID],[self ownerName],[self consumedBytes]];
}
@synthesize name;
@synthesize creationDate;
@synthesize ownerID;
@synthesize ownerName;
+@synthesize consumedBytes;
@end
diff --git a/Classes/S3/ASIS3ServiceRequest.m b/Classes/S3/ASIS3ServiceRequest.m
index b261b771..23eeb54b 100644
--- a/Classes/S3/ASIS3ServiceRequest.m
+++ b/Classes/S3/ASIS3ServiceRequest.m
@@ -70,6 +70,7 @@ - (void)parseResponseJson {
ASIS3Bucket *bucket = [ASIS3Bucket bucketWithOwnerID:[self ownerID] ownerName:[self ownerName]];
[bucket setName:[item objectForKey:@"Name"]];
[bucket setCreationDate:[[ASIS3Request S3RequestDateFormatter] dateFromString:[item objectForKey:@"CreationDate"]]];
+ [bucket setConsumedBytes:[[item objectForKey:@"ConsumedBytes"] unsignedLongLongValue]];
[[self buckets] addObject:bucket];
}
}
@@ -102,7 +103,9 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
[self setOwnerID:[self currentXMLElementContent]];
} else if ([elementName isEqualToString:@"DisplayName"]) {
[self setOwnerName:[self currentXMLElementContent]];
- } else {
+ } else if ([elementName isEqualToString:@"ConsumedBytes"]) {
+ [[self currentBucket] setConsumedBytes:[[self currentXMLElementContent] longLongValue]];
+ }else {
// Let ASIS3Request look for error messages
[super parser:parser didEndElement:elementName namespaceURI:namespaceURI qualifiedName:qName];
}
From 7c0bd294ac58ecfa80bed5c8ebe880e83de6fa78 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Mon, 21 Jul 2014 18:51:23 +0800
Subject: [PATCH 18/37] update
---
README.md | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 9bac2669..19fb2412 100644
--- a/README.md
+++ b/README.md
@@ -13,16 +13,32 @@ ASI-SCS
####相关配置:
> * 1、下载ASIKit.Framework(你可以手动下载,链接如下;也可以执行步骤(1)—(4),写脚本由程序自动下载)
->>Mac OS X:http://sdk.sinastorage.com/ASIKit.framework.zip
->>iOS:http://sdk.sinastorage.com/ASIKit-iOS.framework.zip
+>> * Mac OS X:http://sdk.sinastorage.com/ASIKit.framework.zip
+>> * iOS:http://sdk.sinastorage.com/ASIKit-iOS.framework.zip
>> * (1)、打开工程,单击XCode侧边栏中的project行,并选择右侧的Build Phase;
>> * (2)、选择项目的Target,在顶部菜单栏选择Editor > Add Build Phase > Add Run Script Build Phase;
>> * (3)、设置Run Script(Mac OS X 与 iOS不同)如下;
>> * (4)、Commond+B编译工程,会自动下载所需的ASIKit.Framework包到工程目录。
-> * 2、选择Link Binary With Libraries,点击“+”,点击“Add Other...”,到工程目录下选择添加ASIKit.Framework
-(或者将下载好的ASIKit.Framework直接拖到xcode工程里的Frameworks分组下,并在Add to targets里选中你所要关联的target)
-> * 3、(对于iOS工程)选择Link Binary With Libraries,点击“+”,添加库:libxml2.dylib,libz.dylib,SystemConfiguration.framework,MobileCoreServices.framework,CFNetwork.framework,CoreGraphics.framework,Foundation.framework,UIKit.framework,CoreFoundation.framework
+> * 2、添加下载的framework到工程
+>> * 选择Link Binary With Libraries;
+>> * 点击“+”;
+>> * 点击“Add Other...”,到工程目录下选择添加ASIKit.Framework。
+>> * (或者将下载好的ASIKit.Framework直接拖到xcode工程里的Frameworks分组下;)
+>> * (在Add to targets里选中你所要关联的target。)
+
+> * 3、(对于iOS工程)添加其他依赖库
+>> * 选择Link Binary With Libraries,点击“+”,添加库:
+>> * libxml2.dylib
+>> * libz.dylib
+>> * SystemConfiguration.framework
+>> * MobileCoreServices.framework
+>> * CFNetwork.framework
+>> * CoreGraphics.framework
+>> * Foundation.framework
+>> * UIKit.framework
+>> * CoreFoundation.framework
+
> * 4、在所需文件中添加头:ASIKit/ASIKit.h
```shell
From c68eda371f7b557abc7942a0ccab8c24dedeae85 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Wed, 23 Jul 2014 12:08:23 +0800
Subject: [PATCH 19/37] update change host
---
Classes/S3/ASIS3Request.m | 2 +-
Classes/Tests/ASISCSRequestTests.m | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Classes/S3/ASIS3Request.m b/Classes/S3/ASIS3Request.m
index 5585373e..e94188bc 100644
--- a/Classes/S3/ASIS3Request.m
+++ b/Classes/S3/ASIS3Request.m
@@ -325,7 +325,7 @@ + (NSData *)HMACSHA1withKey:(NSString *)key forString:(NSString *)string
+ (NSString *)S3Host
{
- return @"sinastorage.com";
+ return @"sinastorage.cn";
//return @"s3.amazonaws.com";
}
diff --git a/Classes/Tests/ASISCSRequestTests.m b/Classes/Tests/ASISCSRequestTests.m
index e72b56c3..558e99ed 100644
--- a/Classes/Tests/ASISCSRequestTests.m
+++ b/Classes/Tests/ASISCSRequestTests.m
@@ -373,7 +373,7 @@ - (void)testGZippedContent
GHAssertTrue(success,@"Failed to GET the correct data from S3");
// Now grab the data using something other than ASIHTTPRequest to ensure other HTTP clients can parse the gzipped content
- NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.sinastorage.com.com/gzipped-data",bucket]]] returningResponse:NULL error:NULL];
+ NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.sinastorage.cn/gzipped-data",bucket]]] returningResponse:NULL error:NULL];
NSString *string = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
success = [string isEqualToString:text];
GHAssertTrue(success,@"Failed to GET the correct data from S3");
@@ -444,7 +444,7 @@ - (void)testListRequest
[listRequest setMarker:@"bar"];
[listRequest setMaxResultCount:5];
[listRequest buildURL];
- NSString *expectedURL = [NSString stringWithFormat:@"http://%@.sinastorage.com/?acl&prefix=foo&marker=bar&delimiter=/&max-keys=5",bucket];
+ NSString *expectedURL = [NSString stringWithFormat:@"http://%@.sinastorage.cn/?acl&prefix=foo&marker=bar&delimiter=/&max-keys=5",bucket];
success = ([[[listRequest url] absoluteString] isEqualToString:expectedURL]);
GHAssertTrue(success,@"Generated the wrong url when requesting a subresource");
From 4e119a5bc6638a1d76a62a2336175dca53ee8ae0 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Wed, 23 Jul 2014 12:13:32 +0800
Subject: [PATCH 20/37] update readme
for change host
---
README.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 19fb2412..67b6c015 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,8 @@ ASI-SCS
####相关配置:
> * 1、下载ASIKit.Framework(你可以手动下载,链接如下;也可以执行步骤(1)—(4),写脚本由程序自动下载)
->> * Mac OS X:http://sdk.sinastorage.com/ASIKit.framework.zip
->> * iOS:http://sdk.sinastorage.com/ASIKit-iOS.framework.zip
+>> * Mac OS X:http://sdk.sinastorage.cn/ASIKit.framework.zip
+>> * iOS:http://sdk.sinastorage.cn/ASIKit-iOS.framework.zip
>> * (1)、打开工程,单击XCode侧边栏中的project行,并选择右侧的Build Phase;
>> * (2)、选择项目的Target,在顶部菜单栏选择Editor > Add Build Phase > Add Run Script Build Phase;
>> * (3)、设置Run Script(Mac OS X 与 iOS不同)如下;
@@ -50,7 +50,7 @@ if [ ! -e $SRCROOT/ASIKit.framework ]; then
mkdir $SRCROOT/ASIKit
cd $SRCROOT/ASIKit
echo "Downloading ASIKit framework"
- curl -s -O http://sdk.sinastorage.com/ASIKit.framework.zip
+ curl -s -O http://sdk.sinastorage.cn/ASIKit.framework.zip
echo "Unzipping ASIKit"
unzip ASIKit.framework.zip
mv ASIKit.framework $SRCROOT
@@ -68,7 +68,7 @@ fi
mkdir $SRCROOT/ASIKit
cd $SRCROOT/ASIKit
echo "Downloading ASIKit-iOS framework"
- curl -s -O http://sdk.sinastorage.com/ASIKit-iOS.framework.zip
+ curl -s -O http://sdk.sinastorage.cn/ASIKit-iOS.framework.zip
echo "Unzipping ASIKit-iOS"
unzip ASIKit-iOS.framework.zip
mv ASIKit.framework $SRCROOT
@@ -126,7 +126,7 @@ if ([request error]) {
####Object操作
#####列取object
```objective-c
-/*示例为列取http://my-bucket.sinastorage.com/images/jpegs中最多50个object*/
+/*示例为列取http://my-bucket.sinastorage.cn/images/jpegs中最多50个object*/
ASIS3BucketRequest *listRequest = [ASIS3BucketRequest requestWithBucket:@"my-bucket"];
[listRequest setPrefix:@"images/jpegs"];
@@ -140,7 +140,7 @@ if (![listRequest error]) {
#####获取object信息
```objective-c
-/*示例为获取http://my-bucket.sinastorage.com/path/to/the/object的object信息*/
+/*示例为获取http://my-bucket.sinastorage.cn/path/to/the/object的object信息*/
NSString *bucket = @"my-bucket";
NSString *path = @"path/to/the/object";
From 4e507042d6ae13a8de085e56cb328589d92f10ba Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Wed, 23 Jul 2014 16:19:46 +0800
Subject: [PATCH 21/37] update
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 67b6c015..f7615a22 100644
--- a/README.md
+++ b/README.md
@@ -23,9 +23,11 @@ ASI-SCS
> * 2、添加下载的framework到工程
>> * 选择Link Binary With Libraries;
>> * 点击“+”;
->> * 点击“Add Other...”,到工程目录下选择添加ASIKit.Framework。
+>> * 点击“Add Other...”,到工程目录下选择添加ASIKit.Framework;
>> * (或者将下载好的ASIKit.Framework直接拖到xcode工程里的Frameworks分组下;)
>> * (在Add to targets里选中你所要关联的target。)
+>> * 选择Copy Files,设置Destination为Frameworks;
+>> * 点击“+”,选择ASIKit.framework。
> * 3、(对于iOS工程)添加其他依赖库
>> * 选择Link Binary With Libraries,点击“+”,添加库:
From eeb37d3256d0eb23b4e0e025f61dcad875594f46 Mon Sep 17 00:00:00 2001
From: Littlebox222
Date: Mon, 18 Aug 2014 17:25:34 +0800
Subject: [PATCH 22/37] update add project SCS-iOS-Demo
---
SCS-iOS-Demo.xcodeproj/project.pbxproj | 506 +++++++++
SCS-iOS-Demo/AppDelegate.h | 23 +
SCS-iOS-Demo/AppDelegate.m | 62 ++
.../AppIcon.appiconset/Contents.json | 23 +
.../LaunchImage.launchimage/Contents.json | 23 +
SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.h | 467 +++++++++
SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.m | 987 ++++++++++++++++++
SCS-iOS-Demo/MBProgressHUD/error.png | Bin 0 -> 3499 bytes
SCS-iOS-Demo/MBProgressHUD/error@2x.png | Bin 0 -> 3857 bytes
SCS-iOS-Demo/MBProgressHUD/success.png | Bin 0 -> 1609 bytes
SCS-iOS-Demo/MBProgressHUD/success@2x.png | Bin 0 -> 2156 bytes
SCS-iOS-Demo/RootViewController.h | 16 +
SCS-iOS-Demo/RootViewController.m | 317 ++++++
SCS-iOS-Demo/SCS-iOS-Demo-Info.plist | 38 +
SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch | 16 +
SCS-iOS-Demo/en.lproj/InfoPlist.strings | 2 +
SCS-iOS-Demo/main.m | 18 +
SCS-iOS-Demo/test.png | Bin 0 -> 8708 bytes
18 files changed, 2498 insertions(+)
create mode 100644 SCS-iOS-Demo.xcodeproj/project.pbxproj
create mode 100644 SCS-iOS-Demo/AppDelegate.h
create mode 100644 SCS-iOS-Demo/AppDelegate.m
create mode 100644 SCS-iOS-Demo/Images.xcassets/AppIcon.appiconset/Contents.json
create mode 100644 SCS-iOS-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json
create mode 100755 SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.h
create mode 100755 SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.m
create mode 100755 SCS-iOS-Demo/MBProgressHUD/error.png
create mode 100755 SCS-iOS-Demo/MBProgressHUD/error@2x.png
create mode 100755 SCS-iOS-Demo/MBProgressHUD/success.png
create mode 100755 SCS-iOS-Demo/MBProgressHUD/success@2x.png
create mode 100644 SCS-iOS-Demo/RootViewController.h
create mode 100644 SCS-iOS-Demo/RootViewController.m
create mode 100644 SCS-iOS-Demo/SCS-iOS-Demo-Info.plist
create mode 100644 SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch
create mode 100644 SCS-iOS-Demo/en.lproj/InfoPlist.strings
create mode 100644 SCS-iOS-Demo/main.m
create mode 100644 SCS-iOS-Demo/test.png
diff --git a/SCS-iOS-Demo.xcodeproj/project.pbxproj b/SCS-iOS-Demo.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..f782d168
--- /dev/null
+++ b/SCS-iOS-Demo.xcodeproj/project.pbxproj
@@ -0,0 +1,506 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ AD01F5A319A1AED6002BF864 /* error.png in Resources */ = {isa = PBXBuildFile; fileRef = AD01F59D19A1AED6002BF864 /* error.png */; };
+ AD01F5A419A1AED6002BF864 /* error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AD01F59E19A1AED6002BF864 /* error@2x.png */; };
+ AD01F5A519A1AED6002BF864 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = AD01F5A019A1AED6002BF864 /* MBProgressHUD.m */; };
+ AD01F5A619A1AED6002BF864 /* success.png in Resources */ = {isa = PBXBuildFile; fileRef = AD01F5A119A1AED6002BF864 /* success.png */; };
+ AD01F5A719A1AED6002BF864 /* success@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AD01F5A219A1AED6002BF864 /* success@2x.png */; };
+ AD01F5A919A1B6DC002BF864 /* test.png in Resources */ = {isa = PBXBuildFile; fileRef = AD01F5A819A1B6DC002BF864 /* test.png */; };
+ AD01F65619A1F8C0002BF864 /* ASIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD01F65519A1F8C0002BF864 /* ASIKit.framework */; };
+ ADE180B0199C9997001FCD06 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180AF199C9997001FCD06 /* Foundation.framework */; };
+ ADE180B2199C9997001FCD06 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180B1199C9997001FCD06 /* CoreGraphics.framework */; };
+ ADE180B4199C9997001FCD06 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180B3199C9997001FCD06 /* UIKit.framework */; };
+ ADE180BA199C9997001FCD06 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ADE180B8199C9997001FCD06 /* InfoPlist.strings */; };
+ ADE180BC199C9997001FCD06 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE180BB199C9997001FCD06 /* main.m */; };
+ ADE180C0199C9997001FCD06 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE180BF199C9997001FCD06 /* AppDelegate.m */; };
+ ADE180C2199C9997001FCD06 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ADE180C1199C9997001FCD06 /* Images.xcassets */; };
+ ADE180E2199C9A37001FCD06 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180E1199C9A37001FCD06 /* libxml2.dylib */; };
+ ADE180E4199C9A41001FCD06 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180E3199C9A41001FCD06 /* libz.dylib */; };
+ ADE180E6199C9A4C001FCD06 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180E5199C9A4C001FCD06 /* SystemConfiguration.framework */; };
+ ADE180E8199C9A57001FCD06 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180E7199C9A57001FCD06 /* MobileCoreServices.framework */; };
+ ADE180EA199C9A64001FCD06 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180E9199C9A64001FCD06 /* CFNetwork.framework */; };
+ ADE180EC199C9A71001FCD06 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE180EB199C9A71001FCD06 /* CoreFoundation.framework */; };
+ ADE180F2199CA4C3001FCD06 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE180F1199CA4C3001FCD06 /* RootViewController.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ AD01F64919A1F600002BF864 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 1D6058910D05DD3D006BFB54;
+ remoteInfo = iPhone;
+ };
+ AD01F64B19A1F600002BF864 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = B55B60C70F765BB00064029C;
+ remoteInfo = Tests;
+ };
+ AD01F64D19A1F600002BF864 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = B576D72311C7F34D0059B815;
+ remoteInfo = iPad;
+ };
+ AD01F64F19A1F600002BF864 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = AD9C704A192DDA5600B6416E;
+ remoteInfo = "ASIKit-iOS";
+ };
+ AD01F65119A1F625002BF864 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = AD9C70AB192DFFCA00B6416E;
+ remoteInfo = ASIKit;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ AD01F59D19A1AED6002BF864 /* error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = error.png; sourceTree = ""; };
+ AD01F59E19A1AED6002BF864 /* error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "error@2x.png"; sourceTree = ""; };
+ AD01F59F19A1AED6002BF864 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = ""; };
+ AD01F5A019A1AED6002BF864 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = ""; };
+ AD01F5A119A1AED6002BF864 /* success.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = success.png; sourceTree = ""; };
+ AD01F5A219A1AED6002BF864 /* success@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "success@2x.png"; sourceTree = ""; };
+ AD01F5A819A1B6DC002BF864 /* test.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = test.png; sourceTree = ""; };
+ AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = iPhone.xcodeproj; sourceTree = ""; };
+ AD01F65519A1F8C0002BF864 /* ASIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASIKit.framework; path = Products/ASIKit.framework; sourceTree = ""; };
+ ADE180AC199C9997001FCD06 /* SCS-iOS-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SCS-iOS-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ ADE180AF199C9997001FCD06 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ ADE180B1199C9997001FCD06 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ ADE180B3199C9997001FCD06 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ ADE180B7199C9997001FCD06 /* SCS-iOS-Demo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SCS-iOS-Demo-Info.plist"; sourceTree = ""; };
+ ADE180B9199C9997001FCD06 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
+ ADE180BB199C9997001FCD06 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
+ ADE180BD199C9997001FCD06 /* SCS-iOS-Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SCS-iOS-Demo-Prefix.pch"; sourceTree = ""; };
+ ADE180BE199C9997001FCD06 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
+ ADE180BF199C9997001FCD06 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
+ ADE180C1199C9997001FCD06 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
+ ADE180C8199C9997001FCD06 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+ ADE180E1199C9A37001FCD06 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
+ ADE180E3199C9A41001FCD06 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
+ ADE180E5199C9A4C001FCD06 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ ADE180E7199C9A57001FCD06 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
+ ADE180E9199C9A64001FCD06 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ ADE180EB199C9A71001FCD06 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
+ ADE180F0199CA4C3001FCD06 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; };
+ ADE180F1199CA4C3001FCD06 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ ADE180A9199C9997001FCD06 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD01F65619A1F8C0002BF864 /* ASIKit.framework in Frameworks */,
+ ADE180EC199C9A71001FCD06 /* CoreFoundation.framework in Frameworks */,
+ ADE180EA199C9A64001FCD06 /* CFNetwork.framework in Frameworks */,
+ ADE180E8199C9A57001FCD06 /* MobileCoreServices.framework in Frameworks */,
+ ADE180E6199C9A4C001FCD06 /* SystemConfiguration.framework in Frameworks */,
+ ADE180E4199C9A41001FCD06 /* libz.dylib in Frameworks */,
+ ADE180E2199C9A37001FCD06 /* libxml2.dylib in Frameworks */,
+ ADE180B2199C9997001FCD06 /* CoreGraphics.framework in Frameworks */,
+ ADE180B4199C9997001FCD06 /* UIKit.framework in Frameworks */,
+ ADE180B0199C9997001FCD06 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ AD01F59C19A1AED6002BF864 /* MBProgressHUD */ = {
+ isa = PBXGroup;
+ children = (
+ AD01F59D19A1AED6002BF864 /* error.png */,
+ AD01F59E19A1AED6002BF864 /* error@2x.png */,
+ AD01F59F19A1AED6002BF864 /* MBProgressHUD.h */,
+ AD01F5A019A1AED6002BF864 /* MBProgressHUD.m */,
+ AD01F5A119A1AED6002BF864 /* success.png */,
+ AD01F5A219A1AED6002BF864 /* success@2x.png */,
+ );
+ path = MBProgressHUD;
+ sourceTree = "";
+ };
+ AD01F64219A1F5FF002BF864 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ AD01F64A19A1F600002BF864 /* ASIHTTPRequest iPhone.app */,
+ AD01F64C19A1F600002BF864 /* Tests.app */,
+ AD01F64E19A1F600002BF864 /* ASIHTTPRequest iPad.app */,
+ AD01F65019A1F600002BF864 /* ASIKit-iOS.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ ADE180A3199C9997001FCD06 = {
+ isa = PBXGroup;
+ children = (
+ AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */,
+ ADE180B5199C9997001FCD06 /* SCS-iOS-Demo */,
+ ADE180AE199C9997001FCD06 /* Frameworks */,
+ ADE180AD199C9997001FCD06 /* Products */,
+ );
+ sourceTree = "";
+ };
+ ADE180AD199C9997001FCD06 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ ADE180AC199C9997001FCD06 /* SCS-iOS-Demo.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ ADE180AE199C9997001FCD06 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AD01F65519A1F8C0002BF864 /* ASIKit.framework */,
+ ADE180EB199C9A71001FCD06 /* CoreFoundation.framework */,
+ ADE180E9199C9A64001FCD06 /* CFNetwork.framework */,
+ ADE180E7199C9A57001FCD06 /* MobileCoreServices.framework */,
+ ADE180E5199C9A4C001FCD06 /* SystemConfiguration.framework */,
+ ADE180E3199C9A41001FCD06 /* libz.dylib */,
+ ADE180E1199C9A37001FCD06 /* libxml2.dylib */,
+ ADE180AF199C9997001FCD06 /* Foundation.framework */,
+ ADE180B1199C9997001FCD06 /* CoreGraphics.framework */,
+ ADE180B3199C9997001FCD06 /* UIKit.framework */,
+ ADE180C8199C9997001FCD06 /* XCTest.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ ADE180B5199C9997001FCD06 /* SCS-iOS-Demo */ = {
+ isa = PBXGroup;
+ children = (
+ AD01F59C19A1AED6002BF864 /* MBProgressHUD */,
+ ADE180BE199C9997001FCD06 /* AppDelegate.h */,
+ ADE180BF199C9997001FCD06 /* AppDelegate.m */,
+ ADE180F0199CA4C3001FCD06 /* RootViewController.h */,
+ ADE180F1199CA4C3001FCD06 /* RootViewController.m */,
+ ADE180B6199C9997001FCD06 /* Supporting Files */,
+ );
+ path = "SCS-iOS-Demo";
+ sourceTree = "";
+ };
+ ADE180B6199C9997001FCD06 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ AD01F5A819A1B6DC002BF864 /* test.png */,
+ ADE180C1199C9997001FCD06 /* Images.xcassets */,
+ ADE180B7199C9997001FCD06 /* SCS-iOS-Demo-Info.plist */,
+ ADE180B8199C9997001FCD06 /* InfoPlist.strings */,
+ ADE180BB199C9997001FCD06 /* main.m */,
+ ADE180BD199C9997001FCD06 /* SCS-iOS-Demo-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ ADE180AB199C9997001FCD06 /* SCS-iOS-Demo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = ADE180D8199C9997001FCD06 /* Build configuration list for PBXNativeTarget "SCS-iOS-Demo" */;
+ buildPhases = (
+ ADE180A8199C9997001FCD06 /* Sources */,
+ ADE180A9199C9997001FCD06 /* Frameworks */,
+ ADE180AA199C9997001FCD06 /* Resources */,
+ ADE180DE199C99C9001FCD06 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ AD01F65219A1F625002BF864 /* PBXTargetDependency */,
+ );
+ name = "SCS-iOS-Demo";
+ productName = "SCS-iOS-Demo";
+ productReference = ADE180AC199C9997001FCD06 /* SCS-iOS-Demo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ ADE180A4199C9997001FCD06 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0510;
+ ORGANIZATIONNAME = Littlebox222;
+ };
+ buildConfigurationList = ADE180A7199C9997001FCD06 /* Build configuration list for PBXProject "SCS-iOS-Demo" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = ADE180A3199C9997001FCD06;
+ productRefGroup = ADE180AD199C9997001FCD06 /* Products */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = AD01F64219A1F5FF002BF864 /* Products */;
+ ProjectRef = AD01F64119A1F5FF002BF864 /* iPhone.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ ADE180AB199C9997001FCD06 /* SCS-iOS-Demo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ AD01F64A19A1F600002BF864 /* ASIHTTPRequest iPhone.app */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.application;
+ path = "ASIHTTPRequest iPhone.app";
+ remoteRef = AD01F64919A1F600002BF864 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ AD01F64C19A1F600002BF864 /* Tests.app */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.application;
+ path = Tests.app;
+ remoteRef = AD01F64B19A1F600002BF864 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ AD01F64E19A1F600002BF864 /* ASIHTTPRequest iPad.app */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.application;
+ path = "ASIHTTPRequest iPad.app";
+ remoteRef = AD01F64D19A1F600002BF864 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ AD01F65019A1F600002BF864 /* ASIKit-iOS.framework */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.cfbundle;
+ path = "ASIKit-iOS.framework";
+ remoteRef = AD01F64F19A1F600002BF864 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ ADE180AA199C9997001FCD06 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ ADE180BA199C9997001FCD06 /* InfoPlist.strings in Resources */,
+ ADE180C2199C9997001FCD06 /* Images.xcassets in Resources */,
+ AD01F5A919A1B6DC002BF864 /* test.png in Resources */,
+ AD01F5A719A1AED6002BF864 /* success@2x.png in Resources */,
+ AD01F5A619A1AED6002BF864 /* success.png in Resources */,
+ AD01F5A319A1AED6002BF864 /* error.png in Resources */,
+ AD01F5A419A1AED6002BF864 /* error@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ ADE180DE199C99C9001FCD06 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ ADE180A8199C9997001FCD06 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ ADE180C0199C9997001FCD06 /* AppDelegate.m in Sources */,
+ ADE180BC199C9997001FCD06 /* main.m in Sources */,
+ ADE180F2199CA4C3001FCD06 /* RootViewController.m in Sources */,
+ AD01F5A519A1AED6002BF864 /* MBProgressHUD.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ AD01F65219A1F625002BF864 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = ASIKit;
+ targetProxy = AD01F65119A1F625002BF864 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ ADE180B8199C9997001FCD06 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ ADE180B9199C9997001FCD06 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ ADE180D6199C9997001FCD06 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ ADE180D7199C9997001FCD06 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ ADE180D9199C9997001FCD06 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = YES;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+ CLANG_ENABLE_OBJC_ARC = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)",
+ "$(PROJECT_DIR)/Products",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch";
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "$(SRCROOT)/asi-scs/**",
+ );
+ INFOPLIST_FILE = "SCS-iOS-Demo/SCS-iOS-Demo-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ ADE180DA199C9997001FCD06 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = YES;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+ CLANG_ENABLE_OBJC_ARC = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)",
+ "$(PROJECT_DIR)/Products",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch";
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "$(SRCROOT)/asi-scs/**",
+ );
+ INFOPLIST_FILE = "SCS-iOS-Demo/SCS-iOS-Demo-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ ADE180A7199C9997001FCD06 /* Build configuration list for PBXProject "SCS-iOS-Demo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ ADE180D6199C9997001FCD06 /* Debug */,
+ ADE180D7199C9997001FCD06 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ ADE180D8199C9997001FCD06 /* Build configuration list for PBXNativeTarget "SCS-iOS-Demo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ ADE180D9199C9997001FCD06 /* Debug */,
+ ADE180DA199C9997001FCD06 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = ADE180A4199C9997001FCD06 /* Project object */;
+}
diff --git a/SCS-iOS-Demo/AppDelegate.h b/SCS-iOS-Demo/AppDelegate.h
new file mode 100644
index 00000000..8c2706b5
--- /dev/null
+++ b/SCS-iOS-Demo/AppDelegate.h
@@ -0,0 +1,23 @@
+//
+// AppDelegate.h
+// SCS-iOS-Demo
+//
+// Created by Littlebox222 on 14-8-14.
+// Copyright (c) 2014年 Littlebox222. All rights reserved.
+//
+
+#import
+#import
+
+#define kAccessKey @"YOUR ACCESSKEY"
+#define kSecretKey @"YOUR SECRETKEY"
+
+
+
+#define kUserTestBucketCreate @"test-create"
+
+@interface AppDelegate : UIResponder
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
diff --git a/SCS-iOS-Demo/AppDelegate.m b/SCS-iOS-Demo/AppDelegate.m
new file mode 100644
index 00000000..6118c962
--- /dev/null
+++ b/SCS-iOS-Demo/AppDelegate.m
@@ -0,0 +1,62 @@
+//
+// AppDelegate.m
+// SCS-iOS-Demo
+//
+// Created by Littlebox222 on 14-8-14.
+// Copyright (c) 2014年 Littlebox222. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import "RootViewController.h"
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ self.window.backgroundColor = [UIColor whiteColor];
+
+ if ([kAccessKey isEqualToString:@"YOUR ACCESSKEY"] || [kSecretKey isEqualToString:@"YOUR SECRETKEY"]) {
+
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"错误" message:@"请在AppDelegate.h中填写您的accessKey与secretKey" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
+ [alert show];
+ [alert release];
+
+ }else {
+ RootViewController *rootViewController = [[[RootViewController alloc] initWithStyle:UITableViewStylePlain] autorelease];
+ rootViewController.title = @"操作结果见控制台";
+ UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:rootViewController] autorelease];
+ [self.window setRootViewController:nav];
+ }
+
+
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+
+}
+
+@end
diff --git a/SCS-iOS-Demo/Images.xcassets/AppIcon.appiconset/Contents.json b/SCS-iOS-Demo/Images.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 00000000..a396706d
--- /dev/null
+++ b/SCS-iOS-Demo/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/SCS-iOS-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json b/SCS-iOS-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json
new file mode 100644
index 00000000..c79ebd3a
--- /dev/null
+++ b/SCS-iOS-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "subtype" : "retina4",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.h b/SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.h
new file mode 100755
index 00000000..b701d7fc
--- /dev/null
+++ b/SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.h
@@ -0,0 +1,467 @@
+//
+// MBProgressHUD.h
+// Version 0.5
+// Created by Matej Bukovinski on 2.4.09.
+//
+
+// This code is distributed under the terms and conditions of the MIT license.
+
+// Copyright (c) 2011 Matej Bukovinski
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import
+#import
+#import
+
+@protocol MBProgressHUDDelegate;
+
+
+typedef enum {
+ /** Progress is shown using an UIActivityIndicatorView. This is the default. */
+ MBProgressHUDModeIndeterminate,
+ /** Progress is shown using a round, pie-chart like, progress view. */
+ MBProgressHUDModeDeterminate,
+ /** Progress is shown using a ring-shaped progress view. */
+ MBProgressHUDModeAnnularDeterminate,
+ /** Shows a custom view */
+ MBProgressHUDModeCustomView,
+ /** Shows only labels */
+ MBProgressHUDModeText,
+ /**show a error view**/
+ MBProgressHUDModeError,
+ /**show a right view **/
+ MBProgressHUDModeSuccess
+} MBProgressHUDMode;
+
+typedef enum {
+ /** Opacity animation */
+ MBProgressHUDAnimationFade,
+ /** Opacity + scale animation */
+ MBProgressHUDAnimationZoom,
+ MBProgressHUDAnimationZoomOut = MBProgressHUDAnimationZoom,
+ MBProgressHUDAnimationZoomIn
+} MBProgressHUDAnimation;
+
+
+#ifndef MB_STRONG
+#if __has_feature(objc_arc)
+ #define MB_STRONG strong
+#else
+ #define MB_STRONG retain
+#endif
+#endif
+
+#ifndef MB_WEAK
+#if __has_feature(objc_arc_weak)
+ #define MB_WEAK weak
+#elif __has_feature(objc_arc)
+ #define MB_WEAK unsafe_unretained
+#else
+ #define MB_WEAK assign
+#endif
+#endif
+
+#if NS_BLOCKS_AVAILABLE
+typedef void (^MBProgressHUDCompletionBlock)();
+#endif
+
+
+
+
+/**
+ * Displays a simple HUD window containing a progress indicator and two optional labels for short messages.
+ *
+ * This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class.
+ * The MBProgressHUD window spans over the entire space given to it by the initWithFrame constructor and catches all
+ * user input on this region, thereby preventing the user operations on components below the view. The HUD itself is
+ * drawn centered as a rounded semi-transparent view which resizes depending on the user specified content.
+ *
+ * This view supports four modes of operation:
+ * - MBProgressHUDModeIndeterminate - shows a UIActivityIndicatorView
+ * - MBProgressHUDModeDeterminate - shows a custom round progress indicator
+ * - MBProgressHUDModeAnnularDeterminate - shows a custom annular progress indicator
+ * - MBProgressHUDModeCustomView - shows an arbitrary, user specified view (@see customView)
+ *
+ * All three modes can have optional labels assigned:
+ * - If the labelText property is set and non-empty then a label containing the provided content is placed below the
+ * indicator view.
+ * - If also the detailsLabelText property is set then another label is placed below the first label.
+ */
+@interface MBProgressHUD : UIView
+
+/**
+ * Creates a new custom HUD
+
+ */
+
++(MBProgressHUD *)showHUDAddedTo:(UIView *)view text:(NSString *)text;
+
++(MBProgressHUD *)showSuccessHUDAddedTo:(UIView *)view text:(NSString *)text duration:(NSTimeInterval)duration;
+
++(MBProgressHUD *)showErrorHUDAddedTo:(UIView *)view text:(NSString *)text duration:(NSTimeInterval)duration;
+
++(MBProgressHUD *)showHUDAddedTo:(UIView *)view text:(NSString *)text mode:(MBProgressHUDMode)mode afterDelay:(NSTimeInterval)seconds;
+
+/**
+ * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:.
+ *
+ * @param view The view that the HUD will be added to
+ * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use
+ * animations while appearing.
+ * @return A reference to the created HUD.
+ *
+ * @see hideHUDForView:animated:
+ * @see animationType
+ */
++ (MBProgressHUD *)showHUDAddedTo:(UIView *)view animated:(BOOL)animated;
+
+/**
+ add hidehud
+ **/
++ (BOOL)hideHUDForView:(UIView *)view;
+
+/**
+ * Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:.
+ *
+ * @param view The view that is going to be searched for a HUD subview.
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ * @return YES if a HUD was found and removed, NO otherwise.
+ *
+ * @see showHUDAddedTo:animated:
+ * @see animationType
+ */
++ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated;
+
+/**
+ * Finds all the HUD subviews and hides them.
+ *
+ * @param view The view that is going to be searched for HUD subviews.
+ * @param animated If set to YES the HUDs will disappear using the current animationType. If set to NO the HUDs will not use
+ * animations while disappearing.
+ * @return the number of HUDs found and removed.
+ *
+ * @see hideAllHUDForView:animated:
+ * @see animationType
+ */
++ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated;
+
+/**
+ * Finds the top-most HUD subview and returns it.
+ *
+ * @param view The view that is going to be searched.
+ * @return A reference to the last HUD subview discovered.
+ */
++ (MBProgressHUD *)HUDForView:(UIView *)view;
+
+/**
+ * Finds all HUD subviews and returns them.
+ *
+ * @param view The view that is going to be searched.
+ * @return All found HUD views (array of MBProgressHUD objects).
+ */
++ (NSArray *)allHUDsForView:(UIView *)view;
+
+/**
+ * A convenience constructor that initializes the HUD with the window's bounds. Calls the designated constructor with
+ * window.bounds as the parameter.
+ *
+ * @param window The window instance that will provide the bounds for the HUD. Should be the same instance as
+ * the HUD's superview (i.e., the window that the HUD will be added to).
+ */
+- (id)initWithWindow:(UIWindow *)window;
+
+/**
+ * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with
+ * view.bounds as the parameter
+ *
+ * @param view The view instance that will provide the bounds for the HUD. Should be the same instance as
+ * the HUD's superview (i.e., the view that the HUD will be added to).
+ */
+- (id)initWithView:(UIView *)view;
+
+/**
+ * Display the HUD. You need to make sure that the main thread completes its run loop soon after this method call so
+ * the user interface can be updated. Call this method when your task is already set-up to be executed in a new thread
+ * (e.g., when using something like NSOperation or calling an asynchronous call like NSURLRequest).
+ *
+ * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use
+ * animations while appearing.
+ *
+ * @see animationType
+ */
+- (void)show:(BOOL)animated;
+
+/**
+ * Hide the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
+ * hide the HUD when your task completes.
+ *
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ *
+ * @see animationType
+ */
+- (void)hide:(BOOL)animated;
+
+/**
+ * Hide the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
+ * hide the HUD when your task completes.
+ *
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ * @param delay Delay in secons until the HUD is hidden.
+ *
+ * @see animationType
+ */
+- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay;
+
+/**
+ * Shows the HUD while a background task is executing in a new thread, then hides the HUD.
+ *
+ * This method also takes care of autorelease pools so your method does not have to be concerned with setting up a
+ * pool.
+ *
+ * @param method The method to be executed while the HUD is shown. This method will be executed in a new thread.
+ * @param target The object that the target method belongs to.
+ * @param object An optional object to be passed to the method.
+ * @param animated If set to YES the HUD will (dis)appear using the current animationType. If set to NO the HUD will not use
+ * animations while (dis)appearing.
+ */
+- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated;
+
+#if NS_BLOCKS_AVAILABLE
+
+/**
+ * Shows the HUD while a block is executing on a background queue, then hides the HUD.
+ *
+ * @see showAnimated:whileExecutingBlock:onQueue:completion:
+ */
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block;
+
+/**
+ * Shows the HUD while a block is executing on a background queue, then hides the HUD.
+ *
+ * @see showAnimated:whileExecutingBlock:onQueue:completion:
+ */
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(MBProgressHUDCompletionBlock)completion;
+
+/**
+ * Shows the HUD while a block is executing on the specified dispatch queue, then hides the HUD.
+ *
+ * @see showAnimated:whileExecutingBlock:onQueue:completion:
+ */
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue;
+
+/**
+ * Shows the HUD while a block is executing on the specified dispatch queue, executes completion block on the main queue, and then hides the HUD.
+ *
+ * @param animated If set to YES the HUD will (dis)appear using the current animationType. If set to NO the HUD will
+ * not use animations while (dis)appearing.
+ * @param block The block to be executed while the HUD is shown.
+ * @param queue The dispatch queue on which the block should be execouted.
+ * @param completion The block to be executed on completion.
+ *
+ * @see completionBlock
+ */
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
+ completionBlock:(MBProgressHUDCompletionBlock)completion;
+
+/**
+ * A block that gets called after the HUD was completely hiden.
+ */
+@property (atomic, copy) MBProgressHUDCompletionBlock completionBlock;
+
+#endif
+
+/**
+ * MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate.
+ *
+ * @see MBProgressHUDMode
+ */
+@property (atomic, assign) MBProgressHUDMode mode;
+
+/**
+ * The animation type that should be used when the HUD is shown and hidden.
+ *
+ * @see MBProgressHUDAnimation
+ */
+@property (atomic, assign) MBProgressHUDAnimation animationType;
+
+/**
+ * The UIView (e.g., a UIImageView) to be shown when the HUD is in MBProgressHUDModeCustomView.
+ * For best results use a 37 by 37 pixel view (so the bounds match the built in indicator bounds).
+ */
+@property (atomic, MB_STRONG) UIView *customView;
+
+/**
+ * The HUD delegate object.
+ *
+ * @see MBProgressHUDDelegate
+ */
+@property (atomic, MB_WEAK) id delegate;
+
+/**
+ * An optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit
+ * the entire text. If the text is too long it will get clipped by displaying "..." at the end. If left unchanged or
+ * set to @"", then no message is displayed.
+ */
+@property (atomic, copy) NSString *labelText;
+
+/**
+ * An optional details message displayed below the labelText message. This message is displayed only if the labelText
+ * property is also set and is different from an empty string (@""). The details text can span multiple lines.
+ */
+@property (atomic, copy) NSString *detailsLabelText;
+
+/**
+ * The opacity of the HUD window. Defaults to 0.8 (80% opacity).
+ */
+@property (atomic, assign) float opacity;
+
+/**
+ * The color of the HUD window. Defaults to black. If this property is set, color is set using
+ * this UIColor and the opacity property is not used. using retain because performing copy on
+ * UIColor base colors (like [UIColor greenColor]) cause problems with the copyZone.
+ */
+@property (atomic, MB_STRONG) UIColor *color;
+
+/**
+ * The x-axis offset of the HUD relative to the centre of the superview.
+ */
+@property (atomic, assign) float xOffset;
+
+/**
+ * The y-ayis offset of the HUD relative to the centre of the superview.
+ */
+@property (atomic, assign) float yOffset;
+
+/**
+ * The amounth of space between the HUD edge and the HUD elements (labels, indicators or custom views).
+ * Defaults to 20.0
+ */
+@property (atomic, assign) float margin;
+
+/**
+ * Cover the HUD background view with a radial gradient.
+ */
+@property (atomic, assign) BOOL dimBackground;
+
+/*
+ * Grace period is the time (in seconds) that the invoked method may be run without
+ * showing the HUD. If the task finishes before the grace time runs out, the HUD will
+ * not be shown at all.
+ * This may be used to prevent HUD display for very short tasks.
+ * Defaults to 0 (no grace time).
+ * Grace time functionality is only supported when the task status is known!
+ * @see taskInProgress
+ */
+@property (atomic, assign) float graceTime;
+
+/**
+ * The minimum time (in seconds) that the HUD is shown.
+ * This avoids the problem of the HUD being shown and than instantly hidden.
+ * Defaults to 0 (no minimum show time).
+ */
+@property (atomic, assign) float minShowTime;
+
+/**
+ * Indicates that the executed operation is in progress. Needed for correct graceTime operation.
+ * If you don't set a graceTime (different than 0.0) this does nothing.
+ * This property is automatically set when using showWhileExecuting:onTarget:withObject:animated:.
+ * When threading is done outside of the HUD (i.e., when the show: and hide: methods are used directly),
+ * you need to set this property when your task starts and completes in order to have normal graceTime
+ * functionality.
+ */
+@property (atomic, assign) BOOL taskInProgress;
+
+/**
+ * Removes the HUD from its parent view when hidden.
+ * Defaults to NO.
+ */
+@property (atomic, assign) BOOL removeFromSuperViewOnHide;
+
+/**
+ * Font to be used for the main label. Set this property if the default is not adequate.
+ */
+@property (atomic, MB_STRONG) UIFont* labelFont;
+
+/**
+ * Font to be used for the details label. Set this property if the default is not adequate.
+ */
+@property (atomic, MB_STRONG) UIFont* detailsLabelFont;
+
+/**
+ * The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0.
+ */
+@property (atomic, assign) float progress;
+
+/**
+ * The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size).
+ */
+@property (atomic, assign) CGSize minSize;
+
+/**
+ * Force the HUD dimensions to be equal if possible.
+ */
+@property (atomic, assign, getter = isSquare) BOOL square;
+
+@end
+
+
+@protocol MBProgressHUDDelegate
+
+@optional
+
+/**
+ * Called after the HUD was fully hidden from the screen.
+ */
+- (void)hudWasHidden:(MBProgressHUD *)hud;
+
+@end
+
+
+/**
+ * A progress view for showing definite progress by filling up a circle (pie chart).
+ */
+@interface MBRoundProgressView : UIView
+
+/**
+ * Progress (0.0 to 1.0)
+ */
+@property (nonatomic, assign) float progress;
+
+/*
+ * Display mode - NO = round or YES = annular. Defaults to round.
+ */
+@property (nonatomic, assign, getter = isAnnular) BOOL annular;
+
+@end
+
+@interface MBRoundProgressErrorView : UIView
+
+@property (nonatomic, retain) UIImageView *errorView;
+
+@end
+
+@interface MBRoundProgressSuccessView : UIView
+
+@property (nonatomic, retain) UIImageView *successView;
+
+@end
\ No newline at end of file
diff --git a/SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.m b/SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.m
new file mode 100755
index 00000000..e50fab9e
--- /dev/null
+++ b/SCS-iOS-Demo/MBProgressHUD/MBProgressHUD.m
@@ -0,0 +1,987 @@
+//
+// MBProgressHUD.m
+// Version 0.5
+// Created by Matej Bukovinski on 2.4.09.
+//
+
+#import "MBProgressHUD.h"
+
+
+#if __has_feature(objc_arc)
+ #define MB_AUTORELEASE(exp) exp
+ #define MB_RELEASE(exp) exp
+ #define MB_RETAIN(exp) exp
+#else
+ #define MB_AUTORELEASE(exp) [exp autorelease]
+ #define MB_RELEASE(exp) [exp release]
+ #define MB_RETAIN(exp) [exp retain]
+#endif
+
+
+static const CGFloat kPadding = 4.f;
+static const CGFloat kLabelFontSize = 16.f;
+static const CGFloat kDetailsLabelFontSize = 12.f;
+
+
+@interface MBProgressHUD ()
+
+- (void)setupLabels;
+- (void)registerForKVO;
+- (void)unregisterFromKVO;
+- (NSArray *)observableKeypaths;
+- (void)registerForNotifications;
+- (void)unregisterFromNotifications;
+- (void)updateUIForKeypath:(NSString *)keyPath;
+- (void)hideUsingAnimation:(BOOL)animated;
+- (void)showUsingAnimation:(BOOL)animated;
+- (void)done;
+- (void)updateIndicators;
+- (void)handleGraceTimer:(NSTimer *)theTimer;
+- (void)handleMinShowTimer:(NSTimer *)theTimer;
+- (void)setTransformForCurrentOrientation:(BOOL)animated;
+- (void)cleanUp;
+- (void)launchExecution;
+- (void)deviceOrientationDidChange:(NSNotification *)notification;
+- (void)hideDelayed:(NSNumber *)animated;
+
+@property (atomic, MB_STRONG) UIView *indicator;
+@property (atomic, MB_STRONG) NSTimer *graceTimer;
+@property (atomic, MB_STRONG) NSTimer *minShowTimer;
+@property (atomic, MB_STRONG) NSDate *showStarted;
+@property (atomic, assign) CGSize size;
+
+@end
+
+
+@implementation MBProgressHUD {
+ BOOL useAnimation;
+ SEL methodForExecution;
+ id targetForExecution;
+ id objectForExecution;
+ UILabel *label;
+ UILabel *detailsLabel;
+ BOOL isFinished;
+ CGAffineTransform rotationTransform;
+}
+
+#pragma mark - Properties
+
+@synthesize animationType;
+@synthesize delegate;
+@synthesize opacity;
+@synthesize color;
+@synthesize labelFont;
+@synthesize detailsLabelFont;
+@synthesize indicator;
+@synthesize xOffset;
+@synthesize yOffset;
+@synthesize minSize;
+@synthesize square;
+@synthesize margin;
+@synthesize dimBackground;
+@synthesize graceTime;
+@synthesize minShowTime;
+@synthesize graceTimer;
+@synthesize minShowTimer;
+@synthesize taskInProgress;
+@synthesize removeFromSuperViewOnHide;
+@synthesize customView;
+@synthesize showStarted;
+@synthesize mode;
+@synthesize labelText;
+@synthesize detailsLabelText;
+@synthesize progress;
+@synthesize size;
+#if NS_BLOCKS_AVAILABLE
+@synthesize completionBlock;
+#endif
+
+#pragma mark - Class methods
+
++(MBProgressHUD *)showHUDAddedTo:(UIView *)view text:(NSString *)text
+{
+ return [MBProgressHUD showHUDAddedTo:view text:text mode:MBProgressHUDModeIndeterminate afterDelay:0];
+}
+
++(MBProgressHUD *)showSuccessHUDAddedTo:(UIView *)view text:(NSString *)text duration:(NSTimeInterval)duration
+{
+ [MBProgressHUD hideHUDForView:view];
+ return [MBProgressHUD showHUDAddedTo:view text:text mode:MBProgressHUDModeSuccess afterDelay:duration];
+}
+
++(MBProgressHUD *)showErrorHUDAddedTo:(UIView *)view text:(NSString *)text duration:(NSTimeInterval)duration
+{
+ [MBProgressHUD hideHUDForView:view];
+ return [MBProgressHUD showHUDAddedTo:view text:text mode:MBProgressHUDModeError afterDelay:duration];
+}
+
++(MBProgressHUD *)showHUDAddedTo:(UIView *)view text:(NSString *)text mode:(MBProgressHUDMode)mode afterDelay:(NSTimeInterval)seconds
+{
+ return [MBProgressHUD showHUDAddedTo:view text:text mode:mode afterDelay:seconds animated:YES];
+}
++(MBProgressHUD *)showHUDAddedTo:(UIView *)view text:(NSString *)text mode:(MBProgressHUDMode)mode afterDelay:(NSTimeInterval)seconds animated:(BOOL)animated
+{
+ MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:view];
+ hud.labelText = text;
+ hud.labelFont = [UIFont boldSystemFontOfSize:16.0];
+ hud.animationType = MBProgressHUDAnimationFade;
+ hud.mode = mode;
+ [view addSubview:hud];
+ [hud show:animated];
+ if (seconds>0) {
+ [NSTimer scheduledTimerWithTimeInterval:seconds target:self selector:@selector(hideView:) userInfo:view repeats:NO];
+ }
+
+ return MB_AUTORELEASE(hud);
+}
+
++ (MBProgressHUD *)showHUDAddedTo:(UIView *)view animated:(BOOL)animated {
+ MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:view];
+ [view addSubview:hud];
+ [hud show:animated];
+ return MB_AUTORELEASE(hud);
+}
+
++ (BOOL)hideView:(NSTimer *)theTimer
+{
+ return [MBProgressHUD hideAllHUDsForView:theTimer.userInfo animated:YES];
+}
+
++ (BOOL)hideHUDForView:(UIView *)view
+{
+ return [MBProgressHUD hideHUDForView:view animated:YES];
+}
+
++ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated {
+ MBProgressHUD *hud = [MBProgressHUD HUDForView:view];
+ if (hud != nil) {
+ hud.removeFromSuperViewOnHide = YES;
+ [hud hide:animated];
+ return YES;
+ }
+ return NO;
+}
+
++ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated {
+ NSArray *huds = [self allHUDsForView:view];
+ for (MBProgressHUD *hud in huds) {
+ hud.removeFromSuperViewOnHide = YES;
+ [hud hide:animated];
+ }
+ return [huds count];
+}
+
++ (MBProgressHUD *)HUDForView:(UIView *)view {
+ MBProgressHUD *hud = nil;
+ NSArray *subviews = view.subviews;
+ Class hudClass = [MBProgressHUD class];
+ for (UIView *aView in subviews) {
+ if ([aView isKindOfClass:hudClass]) {
+ hud = (MBProgressHUD *)aView;
+ }
+ }
+ return hud;
+}
+
++ (NSArray *)allHUDsForView:(UIView *)view {
+ NSMutableArray *huds = [NSMutableArray array];
+ NSArray *subviews = view.subviews;
+ Class hudClass = [MBProgressHUD class];
+ for (UIView *aView in subviews) {
+ if ([aView isKindOfClass:hudClass]) {
+ [huds addObject:aView];
+ }
+ }
+ return [NSArray arrayWithArray:huds];
+}
+
+#pragma mark - Lifecycle
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ // Set default values for properties
+ self.animationType = MBProgressHUDAnimationFade;
+ self.mode = MBProgressHUDModeIndeterminate;
+ self.labelText = nil;
+ self.detailsLabelText = nil;
+ self.opacity = 0.8f;
+ self.color = nil;
+ self.labelFont = [UIFont boldSystemFontOfSize:kLabelFontSize];
+ self.detailsLabelFont = [UIFont boldSystemFontOfSize:kDetailsLabelFontSize];
+ self.xOffset = 0.0f;
+ self.yOffset = 0.0f;
+ self.dimBackground = NO;
+ self.margin = 20.0f;
+ self.graceTime = 0.0f;
+ self.minShowTime = 0.0f;
+ self.removeFromSuperViewOnHide = NO;
+ self.minSize = CGSizeZero;
+ self.square = NO;
+ self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
+ | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
+
+ // Transparent background
+ self.opaque = NO;
+ self.backgroundColor = [UIColor clearColor];
+ // Make it invisible for now
+ self.alpha = 0.0f;
+
+ taskInProgress = NO;
+ rotationTransform = CGAffineTransformIdentity;
+
+ [self setupLabels];
+ [self updateIndicators];
+ [self registerForKVO];
+ [self registerForNotifications];
+ }
+ return self;
+}
+
+- (id)initWithView:(UIView *)view {
+ id me = [self initWithFrame:view.bounds];
+ // We need to take care of rotation ourselfs if we're adding the HUD to a window
+ if ([view isKindOfClass:[UIWindow class]]) {
+ [self setTransformForCurrentOrientation:NO];
+ }
+ return me;
+}
+
+- (id)initWithWindow:(UIWindow *)window {
+ return [self initWithView:window];
+}
+
+- (void)dealloc {
+ [self unregisterFromNotifications];
+ [self unregisterFromKVO];
+#if !__has_feature(objc_arc)
+ [color release];
+ [indicator release];
+ [label release];
+ [detailsLabel release];
+ [labelText release];
+ [detailsLabelText release];
+ [graceTimer release];
+ [minShowTimer release];
+ [showStarted release];
+ [customView release];
+#if NS_BLOCKS_AVAILABLE
+ [completionBlock release];
+#endif
+ [super dealloc];
+#endif
+}
+
+#pragma mark - Show & hide
+
+- (void)show:(BOOL)animated {
+ useAnimation = animated;
+ // If the grace time is set postpone the HUD display
+ if (self.graceTime > 0.0) {
+ self.graceTimer = [NSTimer scheduledTimerWithTimeInterval:self.graceTime target:self
+ selector:@selector(handleGraceTimer:) userInfo:nil repeats:NO];
+ }
+ // ... otherwise show the HUD imediately
+ else {
+ [self setNeedsDisplay];
+ [self showUsingAnimation:useAnimation];
+ }
+}
+
+- (void)hide:(BOOL)animated {
+ useAnimation = animated;
+ // If the minShow time is set, calculate how long the hud was shown,
+ // and pospone the hiding operation if necessary
+ if (self.minShowTime > 0.0 && showStarted) {
+ NSTimeInterval interv = [[NSDate date] timeIntervalSinceDate:showStarted];
+ if (interv < self.minShowTime) {
+ self.minShowTimer = [NSTimer scheduledTimerWithTimeInterval:(self.minShowTime - interv) target:self
+ selector:@selector(handleMinShowTimer:) userInfo:nil repeats:NO];
+ return;
+ }
+ }
+ // ... otherwise hide the HUD immediately
+ [self hideUsingAnimation:useAnimation];
+}
+
+- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay {
+ [self performSelector:@selector(hideDelayed:) withObject:[NSNumber numberWithBool:animated] afterDelay:delay];
+}
+
+- (void)hideDelayed:(NSNumber *)animated {
+ [self hide:[animated boolValue]];
+}
+
+#pragma mark - Timer callbacks
+
+- (void)handleGraceTimer:(NSTimer *)theTimer {
+ // Show the HUD only if the task is still running
+ if (taskInProgress) {
+ [self setNeedsDisplay];
+ [self showUsingAnimation:useAnimation];
+ }
+}
+
+- (void)handleMinShowTimer:(NSTimer *)theTimer {
+ [self hideUsingAnimation:useAnimation];
+}
+
+#pragma mark - Internal show & hide operations
+
+- (void)showUsingAnimation:(BOOL)animated {
+ self.alpha = 0.0f;
+ if (animated && animationType == MBProgressHUDAnimationZoomIn) {
+ self.transform = CGAffineTransformConcat(rotationTransform, CGAffineTransformMakeScale(0.5f, 0.5f));
+ } else if (animated && animationType == MBProgressHUDAnimationZoomOut) {
+ self.transform = CGAffineTransformConcat(rotationTransform, CGAffineTransformMakeScale(1.5f, 1.5f));
+ }
+ self.showStarted = [NSDate date];
+ // Fade in
+ if (animated) {
+ [UIView beginAnimations:nil context:NULL];
+ [UIView setAnimationDuration:0.30];
+ self.alpha = 1.0f;
+ if (animationType == MBProgressHUDAnimationZoomIn || animationType == MBProgressHUDAnimationZoomOut) {
+ self.transform = rotationTransform;
+ }
+ [UIView commitAnimations];
+ }
+ else {
+ self.alpha = 1.0f;
+ }
+}
+
+- (void)hideUsingAnimation:(BOOL)animated {
+ // Fade out
+ if (animated && showStarted) {
+ [UIView beginAnimations:nil context:NULL];
+ [UIView setAnimationDuration:0.30];
+ [UIView setAnimationDelegate:self];
+ [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
+ // 0.02 prevents the hud from passing through touches during the animation the hud will get completely hidden
+ // in the done method
+ if (animationType == MBProgressHUDAnimationZoomIn) {
+ self.transform = CGAffineTransformConcat(rotationTransform, CGAffineTransformMakeScale(1.5f, 1.5f));
+ } else if (animationType == MBProgressHUDAnimationZoomOut) {
+ self.transform = CGAffineTransformConcat(rotationTransform, CGAffineTransformMakeScale(0.5f, 0.5f));
+ }
+
+ self.alpha = 0.02f;
+ [UIView commitAnimations];
+ }
+ else {
+ self.alpha = 0.0f;
+ [self done];
+ }
+ self.showStarted = nil;
+}
+
+- (void)animationFinished:(NSString *)animationID finished:(BOOL)finished context:(void*)context {
+ [self done];
+}
+
+- (void)done {
+ isFinished = YES;
+ self.alpha = 0.0f;
+ if ([delegate respondsToSelector:@selector(hudWasHidden:)]) {
+ [delegate performSelector:@selector(hudWasHidden:) withObject:self];
+ }
+#if NS_BLOCKS_AVAILABLE
+ if (self.completionBlock) {
+ self.completionBlock();
+ self.completionBlock = NULL;
+ }
+#endif
+ if (removeFromSuperViewOnHide) {
+ [self removeFromSuperview];
+ }
+}
+
+#pragma mark - Threading
+
+- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated {
+ methodForExecution = method;
+ targetForExecution = MB_RETAIN(target);
+ objectForExecution = MB_RETAIN(object);
+ // Launch execution in new thread
+ self.taskInProgress = YES;
+ [NSThread detachNewThreadSelector:@selector(launchExecution) toTarget:self withObject:nil];
+ // Show HUD view
+ [self show:animated];
+}
+
+#if NS_BLOCKS_AVAILABLE
+
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block {
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+ [self showAnimated:animated whileExecutingBlock:block onQueue:queue completionBlock:NULL];
+}
+
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(void (^)())completion {
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+ [self showAnimated:animated whileExecutingBlock:block onQueue:queue completionBlock:completion];
+}
+
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue {
+ [self showAnimated:animated whileExecutingBlock:block onQueue:queue completionBlock:NULL];
+}
+
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
+ completionBlock:(MBProgressHUDCompletionBlock)completion {
+ self.taskInProgress = YES;
+ self.completionBlock = completion;
+ dispatch_async(queue, ^(void) {
+ block();
+ dispatch_async(dispatch_get_main_queue(), ^(void) {
+ [self cleanUp];
+ });
+ });
+ [self show:animated];
+}
+
+#endif
+
+- (void)launchExecution {
+ @autoreleasepool {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+ // Start executing the requested task
+ [targetForExecution performSelector:methodForExecution withObject:objectForExecution];
+#pragma clang diagnostic pop
+ // Task completed, update view in main thread (note: view operations should
+ // be done only in the main thread)
+ [self performSelectorOnMainThread:@selector(cleanUp) withObject:nil waitUntilDone:NO];
+ }
+}
+
+- (void)cleanUp {
+ taskInProgress = NO;
+ self.indicator = nil;
+#if !__has_feature(objc_arc)
+ [targetForExecution release];
+ [objectForExecution release];
+#else
+ targetForExecution = nil;
+ objectForExecution = nil;
+#endif
+ [self hide:useAnimation];
+}
+
+#pragma mark - UI
+
+- (void)setupLabels {
+ label = [[UILabel alloc] initWithFrame:self.bounds];
+ label.adjustsFontSizeToFitWidth = NO;
+ label.textAlignment = NSTextAlignmentCenter;
+ label.opaque = NO;
+ label.backgroundColor = [UIColor clearColor];
+ label.textColor = [UIColor whiteColor];
+ label.font = self.labelFont;
+ label.text = self.labelText;
+ [self addSubview:label];
+
+ detailsLabel = [[UILabel alloc] initWithFrame:self.bounds];
+ detailsLabel.font = self.detailsLabelFont;
+ detailsLabel.adjustsFontSizeToFitWidth = NO;
+ detailsLabel.textAlignment = NSTextAlignmentCenter;
+ detailsLabel.opaque = NO;
+ detailsLabel.backgroundColor = [UIColor clearColor];
+ detailsLabel.textColor = [UIColor whiteColor];
+ detailsLabel.numberOfLines = 0;
+ detailsLabel.font = self.detailsLabelFont;
+ detailsLabel.text = self.detailsLabelText;
+ [self addSubview:detailsLabel];
+}
+
+- (void)updateIndicators {
+
+ BOOL isActivityIndicator = [indicator isKindOfClass:[UIActivityIndicatorView class]];
+ BOOL isRoundIndicator = [indicator isKindOfClass:[MBRoundProgressView class]];
+
+ if (mode == MBProgressHUDModeIndeterminate && !isActivityIndicator) {
+ // Update to indeterminate indicator
+ [indicator removeFromSuperview];
+ self.indicator = MB_AUTORELEASE([[UIActivityIndicatorView alloc]
+ initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]);
+ [(UIActivityIndicatorView *)indicator startAnimating];
+ [self addSubview:indicator];
+ }
+ else if (mode == MBProgressHUDModeDeterminate || mode == MBProgressHUDModeAnnularDeterminate) {
+ if (!isRoundIndicator) {
+ // Update to determinante indicator
+ [indicator removeFromSuperview];
+ self.indicator = MB_AUTORELEASE([[MBRoundProgressView alloc] init]);
+ [self addSubview:indicator];
+ }
+ if (mode == MBProgressHUDModeAnnularDeterminate) {
+ [(MBRoundProgressView *)indicator setAnnular:YES];
+ }
+ }
+ else if (mode == MBProgressHUDModeCustomView && customView != indicator) {
+ // Update custom view indicator
+ [indicator removeFromSuperview];
+ self.indicator = customView;
+ [self addSubview:indicator];
+ } else if (mode == MBProgressHUDModeText) {
+ [indicator removeFromSuperview];
+ self.indicator = nil;
+ }
+ else if (mode == MBProgressHUDModeError) {
+ [indicator removeFromSuperview];
+ self.indicator = MB_AUTORELEASE([[MBRoundProgressErrorView alloc] init]);
+ [self addSubview:indicator];
+ }
+ else if (mode == MBProgressHUDModeSuccess) {
+ [indicator removeFromSuperview];
+ self.indicator = MB_AUTORELEASE([[MBRoundProgressSuccessView alloc] init]);
+ [self addSubview:indicator];
+ }
+}
+
+#pragma mark - Layout
+
+- (void)layoutSubviews {
+
+ // Entirely cover the parent view
+ UIView *parent = self.superview;
+ if (parent) {
+ self.frame = parent.bounds;
+ }
+ CGRect bounds = self.bounds;
+
+ // Determine the total widt and height needed
+ CGFloat maxWidth = bounds.size.width - 4 * margin;
+ CGSize totalSize = CGSizeZero;
+
+ CGRect indicatorF = indicator.bounds;
+ indicatorF.size.width = MIN(indicatorF.size.width, maxWidth);
+ totalSize.width = MAX(totalSize.width, indicatorF.size.width);
+ totalSize.height += indicatorF.size.height;
+
+ CGSize labelSize = [label.text sizeWithFont:label.font];
+ labelSize.width = MIN(labelSize.width, maxWidth);
+ totalSize.width = MAX(totalSize.width, labelSize.width);
+ totalSize.height += labelSize.height;
+ if (labelSize.height > 0.f && indicatorF.size.height > 0.f) {
+ totalSize.height += kPadding;
+ }
+
+ CGFloat remainingHeight = bounds.size.height - totalSize.height - kPadding - 4 * margin;
+ CGSize maxSize = CGSizeMake(maxWidth, remainingHeight);
+ CGSize detailsLabelSize = [detailsLabel.text sizeWithFont:detailsLabel.font
+ constrainedToSize:maxSize lineBreakMode:detailsLabel.lineBreakMode];
+ totalSize.width = MAX(totalSize.width, detailsLabelSize.width);
+ totalSize.height += detailsLabelSize.height;
+ if (detailsLabelSize.height > 0.f && (indicatorF.size.height > 0.f || labelSize.height > 0.f)) {
+ totalSize.height += kPadding;
+ }
+
+ totalSize.width += 2 * margin;
+ totalSize.height += 2 * margin;
+
+ // Position elements
+ CGFloat yPos = roundf(((bounds.size.height - totalSize.height) / 2)) + margin + yOffset;
+ CGFloat xPos = xOffset;
+ indicatorF.origin.y = yPos;
+ indicatorF.origin.x = roundf((bounds.size.width - indicatorF.size.width) / 2) + xPos;
+ indicator.frame = indicatorF;
+ yPos += indicatorF.size.height;
+
+ if (labelSize.height > 0.f && indicatorF.size.height > 0.f) {
+ yPos += kPadding;
+ }
+ CGRect labelF;
+ labelF.origin.y = yPos;
+ labelF.origin.x = roundf((bounds.size.width - labelSize.width) / 2) + xPos;
+ labelF.size = labelSize;
+ label.frame = labelF;
+ yPos += labelF.size.height;
+
+ if (detailsLabelSize.height > 0.f && (indicatorF.size.height > 0.f || labelSize.height > 0.f)) {
+ yPos += kPadding;
+ }
+ CGRect detailsLabelF;
+ detailsLabelF.origin.y = yPos;
+ detailsLabelF.origin.x = roundf((bounds.size.width - detailsLabelSize.width) / 2) + xPos;
+ detailsLabelF.size = detailsLabelSize;
+ detailsLabel.frame = detailsLabelF;
+
+ // Enforce minsize and quare rules
+ if (square) {
+ CGFloat max = MAX(totalSize.width, totalSize.height);
+ if (max <= bounds.size.width - 2 * margin) {
+ totalSize.width = max;
+ }
+ if (max <= bounds.size.height - 2 * margin) {
+ totalSize.height = max;
+ }
+ }
+ if (totalSize.width < minSize.width) {
+ totalSize.width = minSize.width;
+ }
+ if (totalSize.height < minSize.height) {
+ totalSize.height = minSize.height;
+ }
+
+ self.size = totalSize;
+}
+
+#pragma mark BG Drawing
+
+- (void)drawRect:(CGRect)rect {
+
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ UIGraphicsPushContext(context);
+
+ if (self.dimBackground) {
+ //Gradient colours
+ size_t gradLocationsNum = 2;
+ CGFloat gradLocations[2] = {0.0f, 1.0f};
+ CGFloat gradColors[8] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.75f};
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, gradColors, gradLocations, gradLocationsNum);
+ CGColorSpaceRelease(colorSpace);
+ //Gradient center
+ CGPoint gradCenter= CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
+ //Gradient radius
+ float gradRadius = MIN(self.bounds.size.width , self.bounds.size.height) ;
+ //Gradient draw
+ CGContextDrawRadialGradient (context, gradient, gradCenter,
+ 0, gradCenter, gradRadius,
+ kCGGradientDrawsAfterEndLocation);
+ CGGradientRelease(gradient);
+ }
+
+ // Set background rect color
+ if (self.color) {
+ CGContextSetFillColorWithColor(context, self.color.CGColor);
+ } else {
+ CGContextSetGrayFillColor(context, 0.0f, self.opacity);
+ }
+
+
+ // Center HUD
+ CGRect allRect = self.bounds;
+ // Draw rounded HUD backgroud rect
+ CGRect boxRect = CGRectMake(roundf((allRect.size.width - size.width) / 2) + self.xOffset,
+ roundf((allRect.size.height - size.height) / 2) + self.yOffset, size.width, size.height);
+ float radius = 10.0f;
+ CGContextBeginPath(context);
+ CGContextMoveToPoint(context, CGRectGetMinX(boxRect) + radius, CGRectGetMinY(boxRect));
+ CGContextAddArc(context, CGRectGetMaxX(boxRect) - radius, CGRectGetMinY(boxRect) + radius, radius, 3 * (float)M_PI / 2, 0, 0);
+ CGContextAddArc(context, CGRectGetMaxX(boxRect) - radius, CGRectGetMaxY(boxRect) - radius, radius, 0, (float)M_PI / 2, 0);
+ CGContextAddArc(context, CGRectGetMinX(boxRect) + radius, CGRectGetMaxY(boxRect) - radius, radius, (float)M_PI / 2, (float)M_PI, 0);
+ CGContextAddArc(context, CGRectGetMinX(boxRect) + radius, CGRectGetMinY(boxRect) + radius, radius, (float)M_PI, 3 * (float)M_PI / 2, 0);
+ CGContextClosePath(context);
+ CGContextFillPath(context);
+
+ UIGraphicsPopContext();
+}
+
+#pragma mark - KVO
+
+- (void)registerForKVO {
+ for (NSString *keyPath in [self observableKeypaths]) {
+ [self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:NULL];
+ }
+}
+
+- (void)unregisterFromKVO {
+ for (NSString *keyPath in [self observableKeypaths]) {
+ [self removeObserver:self forKeyPath:keyPath];
+ }
+}
+
+- (NSArray *)observableKeypaths {
+ return [NSArray arrayWithObjects:@"mode", @"customView", @"labelText", @"labelFont",
+ @"detailsLabelText", @"detailsLabelFont", @"progress", nil];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
+ if (![NSThread isMainThread]) {
+ [self performSelectorOnMainThread:@selector(updateUIForKeypath:) withObject:keyPath waitUntilDone:NO];
+ } else {
+ [self updateUIForKeypath:keyPath];
+ }
+}
+
+- (void)updateUIForKeypath:(NSString *)keyPath {
+ if ([keyPath isEqualToString:@"mode"] || [keyPath isEqualToString:@"customView"]) {
+ [self updateIndicators];
+ } else if ([keyPath isEqualToString:@"labelText"]) {
+ label.text = self.labelText;
+ } else if ([keyPath isEqualToString:@"labelFont"]) {
+ label.font = self.labelFont;
+ } else if ([keyPath isEqualToString:@"detailsLabelText"]) {
+ detailsLabel.text = self.detailsLabelText;
+ } else if ([keyPath isEqualToString:@"detailsLabelFont"]) {
+ detailsLabel.font = self.detailsLabelFont;
+ } else if ([keyPath isEqualToString:@"progress"]) {
+ if ([indicator respondsToSelector:@selector(setProgress:)]) {
+ [(id)indicator setProgress:progress];
+ }
+ return;
+ }
+ [self setNeedsLayout];
+ [self setNeedsDisplay];
+}
+
+#pragma mark - Notifications
+
+- (void)registerForNotifications {
+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+ [nc addObserver:self selector:@selector(deviceOrientationDidChange:)
+ name:UIDeviceOrientationDidChangeNotification object:nil];
+}
+
+- (void)unregisterFromNotifications {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+- (void)deviceOrientationDidChange:(NSNotification *)notification {
+ UIView *superview = self.superview;
+ if (!superview) {
+ return;
+ } else if ([superview isKindOfClass:[UIWindow class]]) {
+ [self setTransformForCurrentOrientation:YES];
+ } else {
+ self.bounds = self.superview.bounds;
+ [self setNeedsDisplay];
+ }
+}
+
+- (void)setTransformForCurrentOrientation:(BOOL)animated {
+ // Stay in sync with the superview
+ if (self.superview) {
+ self.bounds = self.superview.bounds;
+ [self setNeedsDisplay];
+ }
+
+ UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
+ CGFloat radians = 0;
+ if (UIInterfaceOrientationIsLandscape(orientation)) {
+ if (orientation == UIInterfaceOrientationLandscapeLeft) { radians = -(CGFloat)M_PI_2; }
+ else { radians = (CGFloat)M_PI_2; }
+ // Window coordinates differ!
+ self.bounds = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.width);
+ } else {
+ if (orientation == UIInterfaceOrientationPortraitUpsideDown) { radians = (CGFloat)M_PI; }
+ else { radians = 0; }
+ }
+ rotationTransform = CGAffineTransformMakeRotation(radians);
+
+ if (animated) {
+ [UIView beginAnimations:nil context:nil];
+ }
+ [self setTransform:rotationTransform];
+ if (animated) {
+ [UIView commitAnimations];
+ }
+}
+
+@end
+
+
+@implementation MBRoundProgressView {
+ float _progress;
+ BOOL _annular;
+}
+
+#pragma mark - Accessors
+
+- (float)progress {
+ return _progress;
+}
+
+- (void)setProgress:(float)progress {
+ _progress = progress;
+ [self setNeedsDisplay];
+}
+
+- (BOOL)isAnnular {
+ return _annular;
+}
+
+- (void)setAnnular:(BOOL)annular {
+ _annular = annular;
+ [self setNeedsDisplay];
+}
+
+#pragma mark - Lifecycle
+
+- (id)init {
+ return [self initWithFrame:CGRectMake(0.f, 0.f, 37.f, 37.f)];
+}
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.backgroundColor = [UIColor clearColor];
+ self.opaque = NO;
+ _progress = 0.f;
+ _annular = NO;
+ }
+ return self;
+}
+
+#pragma mark - Drawing
+
+- (void)drawRect:(CGRect)rect {
+
+ CGRect allRect = self.bounds;
+ CGRect circleRect = CGRectInset(allRect, 2.0f, 2.0f);
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ if (_annular) {
+ // Draw background
+ CGFloat lineWidth = 5.f;
+ UIBezierPath *processBackgroundPath = [UIBezierPath bezierPath];
+ processBackgroundPath.lineWidth = lineWidth;
+ processBackgroundPath.lineCapStyle = kCGLineCapRound;
+ CGPoint center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
+ CGFloat radius = (self.bounds.size.width - lineWidth)/2;
+ CGFloat startAngle = - ((float)M_PI / 2); // 90 degrees
+ CGFloat endAngle = (2 * (float)M_PI) + startAngle;
+ [processBackgroundPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
+ [[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.1f] set];
+ [processBackgroundPath stroke];
+ // Draw progress
+ UIBezierPath *processPath = [UIBezierPath bezierPath];
+ processPath.lineCapStyle = kCGLineCapRound;
+ processPath.lineWidth = lineWidth;
+ endAngle = (self.progress * 2 * (float)M_PI) + startAngle;
+ [processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
+ [[UIColor whiteColor] set];
+ [processPath stroke];
+ } else {
+ // Draw background
+ CGContextSetRGBStrokeColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // white
+ CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 0.1f); // translucent white
+ CGContextSetLineWidth(context, 2.0f);
+ CGContextFillEllipseInRect(context, circleRect);
+ CGContextStrokeEllipseInRect(context, circleRect);
+ // Draw progress
+ CGPoint center = CGPointMake(allRect.size.width / 2, allRect.size.height / 2);
+ CGFloat radius = (allRect.size.width - 4) / 2;
+ CGFloat startAngle = - ((float)M_PI / 2); // 90 degrees
+ CGFloat endAngle = (self.progress * 2 * (float)M_PI) + startAngle;
+ CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // white
+ CGContextMoveToPoint(context, center.x, center.y);
+ CGContextAddArc(context, center.x, center.y, radius, startAngle, endAngle, 0);
+ CGContextClosePath(context);
+ CGContextFillPath(context);
+ }
+}
+
+@end
+
+@implementation MBRoundProgressErrorView
+{ float _progress;
+ BOOL _annular;
+}
+
+#pragma mark - Accessors
+
+- (float)progress {
+ return _progress;
+}
+
+- (void)setProgress:(float)progress {
+ _progress = progress;
+ [self setNeedsDisplay];
+}
+
+- (BOOL)isAnnular {
+ return _annular;
+}
+
+- (void)setAnnular:(BOOL)annular {
+ _annular = annular;
+ [self setNeedsDisplay];
+}
+
+#pragma mark - Lifecycle
+
+- (id)init {
+ return [self initWithFrame:CGRectMake(0.f, 0.f, 37.f, 37.f)];
+}
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.backgroundColor = [UIColor clearColor];
+ self.opaque = NO;
+ _progress = 0.f;
+ _annular = NO;
+ _errorView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)];
+ _errorView.center = CGPointMake(_errorView.center.x, _errorView.center.y);
+ _errorView.image = [UIImage imageNamed:@"error.png"];
+ [self addSubview:_errorView];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [super dealloc];
+ [_errorView release];
+}
+
+@end
+
+@implementation MBRoundProgressSuccessView
+{ float _progress;
+ BOOL _annular;
+}
+
+#pragma mark - Accessors
+
+- (float)progress {
+ return _progress;
+}
+
+- (void)setProgress:(float)progress {
+ _progress = progress;
+ [self setNeedsDisplay];
+}
+
+- (BOOL)isAnnular {
+ return _annular;
+}
+
+- (void)setAnnular:(BOOL)annular {
+ _annular = annular;
+ [self setNeedsDisplay];
+}
+
+#pragma mark - Lifecycle
+
+- (id)init {
+ return [self initWithFrame:CGRectMake(0.f, 0.f, 37.f, 37.f)];
+}
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.backgroundColor = [UIColor clearColor];
+ self.opaque = NO;
+ _progress = 0.f;
+ _annular = NO;
+ _successView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)];
+ _successView.center = CGPointMake(_successView.center.x, _successView.center.y);
+ _successView.image = [UIImage imageNamed:@"success.png"];
+ [self addSubview:_successView];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ self.successView = nil;
+
+ [super dealloc];
+ //总崩在这里,先改一下试试看
+// [_successView release];
+}
+
+@end
\ No newline at end of file
diff --git a/SCS-iOS-Demo/MBProgressHUD/error.png b/SCS-iOS-Demo/MBProgressHUD/error.png
new file mode 100755
index 0000000000000000000000000000000000000000..2b3115ba044225c8b76b76d9a2b65bd4bf181d77
GIT binary patch
literal 3499
zcmV;c4OH@pP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T
zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&nehQ1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
zfg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C`
z008P>0026e000+nl3&F}0008UNkl6?$|!5m81O*WfWDr8_zZ@xD_=FQtTYiO-;-0TF7p|zpfP;IFH0jdi?tc6@d0DP_@
zwbpLDOKV-wT9>ufrc2F1pVWVCR%`8R6yI<|lBY-(Nb0KZl5`D5a^iqilbj>z^9-ew
z3M!=vN-16AyGp58BOs;JgpF1!rC!(5)$OT{j*dN&X_Bb%Aj!{_O2x6qDwWDO$!Qzy
zKFPQB@)~X)hA7NyUk&E8S>WG*QWtYxCkYHv7VlubTj)KUMJ5|sWby%ya7-u91g#0c5kDVad>rg
z^(%n5!}3&bZ|?&y`+9~d7K@_*X6w9XTL7%SzP^=z0#zs!MgYvYcwjdGSpEI|#Uq7U
zUS1xlR><#CvH`$~L?Xo_fm&Kx8m?Bz4(K|70RWe6)_wx8qS5G&L!GDc`TThinG+Ge
zh@i%AM5ED{B63wk-q@_47Li;&pFeYGm0Da}90Ks(p+YxJ(|mp))>l2=QHP2Rn5Mbb
z5>zgiI|tx{1JEtYvYy#!>VcI2Se9k2c{;v@g@vGq%sL#|Z95?R%}5bRiAdT;7Z#Bh
zo_i`DkMEJZKyt5UCb|=k$DcOPl4OeHe2sR6@%
literal 0
HcmV?d00001
diff --git a/SCS-iOS-Demo/MBProgressHUD/error@2x.png b/SCS-iOS-Demo/MBProgressHUD/error@2x.png
new file mode 100755
index 0000000000000000000000000000000000000000..676341d110950242747cd311e2278d703338646d
GIT binary patch
literal 3857
zcmV+s5AN`ZP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA
z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e
zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5
z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7}
zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf
zVxhe-O!X
z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4
ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR
z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N
z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd
zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS=
zB9o|3v?Y2H`NVi)In3rTB8+ej^>
zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv
zrJpiFnV_ms&8eQ$2WpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^
zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN
zsU20jsWz_8Qg>31P|s0cqrPALg8E|(vWA65poU1JRAaZs8I2(p#xiB`SVGovRs-uS
zYnV-9TeA7=Om+qP8+I>yOjAR1s%ETak!GFdam@h^#
z)@rS0t$wXH+Irf)+G6c;?H29p+V6F6oj{!|o%K3xI`?%6x;DB|x`n#ibhIR?(H}Q3Gzd138Ei2)WAMz7W9Vy`X}HnwgyEn!VS)>mv$8&{hQn>w4zwy3R}t;BYlZQm5)6pty=DfLrs+A-|>>;~;Q
z_F?uV_HFjh9n2gO9o9Q^JA86v({H5aB!kjoO6
zc9$1ZZKsN-Zl8L~mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a
zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT
zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8
zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|=
zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^=
zgB=w+-tUy`ytONMS8KgRef4hA?t0j
zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3?
zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7
zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W
z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU
zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R
za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)}
z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C
z1U^YbK~#9!?AuLCD?1nm@c-%57xXHMh$5o66hTA~5flY&tNXJUIGZWQuXDe_xioM$
z_u}kbR6$Yf5m7`G_adT*D2k%BNzP^}(_(Gylg!M$Cl7?aWSY+WNYYG_evwkbMD>Un
z0t02B43vQ~PzK6`fih4A%0T_TP!@m{08Yr)<#^{|DJxM*NlHS9VzPt~D?$kACC8Vi
zExmI-j_({+gb)_>8l{x@LY+MjLKJJ#KLEa#Wv2l!txX~p^Ph_YAX9dT3&4)WVx00l
zWGK#gC8R*GEXyjM$9qU6Se9k+P@oEhLNz4qSn+rqg+k#Yq!O%nJkA4!dVPJZ6-hT%
zEl4F;4Gj%E5U6}U|5+qmSf4>E!D?)5+5rM6i$XZ
zKR>T_NDx>YfZgBU@9O#jGSu1GSuKa@#Nq(#fq?;6XLXHJ3#bv=1z>By;sETy!9iDd
zyCy?
zP~=~|)6>&1kV@_ihlht*Ay=VU3NAvB*Ik92`Um=?!aqe4ItSk8-4xKctlP
z?n~lQ%0Iowy8EpC{e7iSnm3YtdK@K$$N~5p
z_5C|R1rk7?R%QTl+MC|``nu&cJtqVtYRzH*mgnc^xpt^xtgWqOYQ)lkR1X#du)MIa
z5X|;ze`K@SYFK#y-!vg1kw_q$&DMg&5{X1Q%mHUwO35k=^zu^5ZyyXM$;rd2HYg<_
zshmA{4@*0ezcnP2$x2u(nM|gs*Qs)v#g7#TQhB$LN~OxNSSpoDt7zh?m(c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn
zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj
z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5
zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh**NZ(?$0
z9!LbN!`Ii!Gq1QLF)umQ)5TT^Xog;9W{Q=op^KBLo3ojjp{c2%p(`+;%p9GZ4BcFT
zd1yI^Xl7`P!z~cKDOlVB)oX-PuRhQ*`k<&qifWh;F#Uj-@PrHGz>|Jz9x%NZ0TcGo
z7c)0AFfi@*ba4!+xby;bH97m$;pFsP;yb$h#W|jSY_!?W?Qm%ym&oT+k=*@)P8_NMa^f7@Y?#^B
zC-Q`Zu08mUc`a9|bQN!H^E{`^rx&Dco;hF9VTZ$+009mIyMP^Y3K!-b{3*PJ{cd}i
z!f68@!P4fFDTijiXMUv2@VRA5YVq`PEz^b?g*a}re?b~P3P-pt-m}hI_KtP?rkiUz
z8g8+BFyET%xBQ(9n_HU58XfTtTalRB#%1w*texD;xUryT@$1Cy!mUD
zZQ2S$x&HE(+Qu&NvDe#mBy-Lxv^@T>dy$US$GC<=lkJZ4u2Vjs9NFfuz-nI9%d*{J
z3j+k+mfb!p(70s%b$c!^+auql-kh}%c(|}_?(e_*`WV(TR2(VtFj#Ld@kOHe9>X8z
zb@!*(?cq0fI((tMZDQIX
z%`NyprB`3ND%QcCXLVdME=xf{t1dzm>Bf0U_TP}Hlxc}t#;VK(C%&W1kU&$q(gxUz4kjXQqP-S^-0
l2@a|OoFPnGfBjHBz_8(-my3`7+a;jF-P6_2Wt~$(699{HTBiU2
literal 0
HcmV?d00001
diff --git a/SCS-iOS-Demo/MBProgressHUD/success@2x.png b/SCS-iOS-Demo/MBProgressHUD/success@2x.png
new file mode 100755
index 0000000000000000000000000000000000000000..5ac8c212d87dd78dcdd0bbca602af4793cc9ae20
GIT binary patch
literal 2156
zcmaJ?c~n#B6%P_X!=@At6-A!`EFfe75=bCGLcjzKgn$?*GKAy-0h1S!2P9}Ki{OEg
zX@rO<<4ouT0gHg5&LWgu7A-0VM-fGdrHX4u7B?LGg2MEV(s#~#-*@l1zu#TYeI?w8
z?Uon^3<`y^WV4t&&R6LPFq2LK#crPzc#KKddlEMO|r&Qsz
z#J~g2
zTPt85_*=aHlUNa>l7V<0sDQHMLZopiP6k&pYKR;Zz>qu!g7z*|k(&m=kRlC|0U^;O
z91-9Mgkq^dvxwkusBEbM7D$C4n@PhW95}I9MD_6|Q$l?hVPv8=iAW4Z3Pq+f7{stp
zB8lYZ<40P;G9h7>1eC%{SkW>z1nJibSi>+#WQb=bC>LjgqA)om0Tz>{idT+>xgy_Z
ztZ2np7@;d-@klUuLu>!5)k`X5ehk;;!9|4S(Fdi-yvvcnw(EJAjzXa)*i3qi^3Jnr
z|BM*AZU5^%wL3j^Yur}l`#9W16IV;W^SC|6XLVjn5=@!3SggL|TDloX%5V=oAAY1;
zZM(&}{Blun;?s`_j}op858v&7(LOoxj3TRQZ*6@&yfA-YIDp(R|NcX1eA`Xi`~n^q
z6Ha$?HK{$NwbdA;(`nfu^tWfM4p@COzF*Y*7e(t65{;JD71XtvKL<@lPTHTYKcEiu
z1CG%0JILwPX{=v6OWB=@V(
ztc|4D+5Nq9vF(W+^EHo(M1{mBM>rQBT&ee$lB;jUM{RMox3$-$Ul__lPg^bcm9fIj
zFooto&9gh{zqqm5tboaP1M5nsOhD`2Vpyf3p!@4QT-^`;b1-hoXbR#_*&<@>G0sDmR5!*k1bApA7(VF
zZzE^bl&?N)Ik?HE>qvOPA$5YbDIrQ&-#0d)tk*fK(ON!hw@q%!WtHhis{@1MdFw{?
zC(ro(p*CNHGTD*$gX{`zRyIR=^OI_TrjckImH68DwkH*891iCm$o*=6OvBCelB1dp
zu5dgVoRErufW3#wr@$~L%r-*DE*(R`}E{~trnzIYqP
z-nBvJQEXRJSwHNp+m0SEVPCX&$Mje}|7yhD&zoCUSC{d)Gj~+8v*r4V{P@k5R8qu5N?&_8#Vx|Ka4z9k`(G0ur0j4#rcW9~ZxalD?LxiP
zP2@bTRaaFr!`Z|<(wk7txH;Zck
zGc$>ozI*WD!v{BuWK<;-d+uklaSMz6Cc)YH*42L%XpY8vnS@^a{`>7icREqy+4?LO
z<+cQJ)SNnn`(s4;YuTCePv;zrY}D>%4~w}kv;*1M*{nF@7JYZvZRm~9BWkRuBl26v
ziPm)hkJmb;lMK2~PzN6BoZRYT_O%~BetcqnKD)oMcYI@R)TGni_)R~ZE&buV!iM7J
z7ReHO%voz&TU#|%{qm3rz`*TkH^)fmQF?7^$vKuq%ueSAY=+uHWC^
z5}^LGog?pO?JEB7XZKkAT6eH-8~n|$Cb~VN_i$8QKrpcpJUD6nuEN1|>kgyo*!94a
zNokMFgs_Tlarg`4
+
+@interface RootViewController : UITableViewController ;
+
+@property (strong, nonatomic) ASINetworkQueue *globleNetWorkQueue;
+
+@end
diff --git a/SCS-iOS-Demo/RootViewController.m b/SCS-iOS-Demo/RootViewController.m
new file mode 100644
index 00000000..d7878bb0
--- /dev/null
+++ b/SCS-iOS-Demo/RootViewController.m
@@ -0,0 +1,317 @@
+//
+// RootViewController.m
+// SCS-iOS-Demo
+//
+// Created by Littlebox222 on 14-8-14.
+// Copyright (c) 2014年 Littlebox222. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import "RootViewController.h"
+#import "MBProgressHUD.h"
+
+@interface RootViewController ()
+
+@end
+
+@implementation RootViewController
+
+- (id)initWithStyle:(UITableViewStyle)style
+{
+ self = [super initWithStyle:style];
+ if (self) {
+
+#ifdef __IPHONE_7_0
+ if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
+ self.edgesForExtendedLayout = UIRectEdgeNone;
+ }
+#endif
+
+ }
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+
+
+ [ASIS3Request setSharedSecretAccessKey:kSecretKey];
+ [ASIS3Request setSharedAccessKey:kAccessKey];
+
+ self.globleNetWorkQueue = [ASINetworkQueue queue];
+ [self.globleNetWorkQueue setDelegate:self];
+ [self.globleNetWorkQueue setRequestDidFinishSelector:@selector(requestDidFinished:)];
+ [self.globleNetWorkQueue setRequestDidFailSelector:@selector(requestDidFailed:)];
+ [self.globleNetWorkQueue setRequestDidReceiveResponseHeadersSelector:@selector(requestDidReceivedResponseHeaders:)];
+ [self.globleNetWorkQueue setRequestDidStartSelector:@selector(requestDidStarted:)];
+ [self.globleNetWorkQueue setRequestWillRedirectSelector:@selector(requestWillRedirect:)];
+ [self.globleNetWorkQueue setShouldCancelAllRequestsOnFailure:NO];
+
+ [self.globleNetWorkQueue go];
+
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+}
+
+- (void)dealloc {
+
+ [self.globleNetWorkQueue cancelAllOperations];
+ self.globleNetWorkQueue.delegate = nil;
+ [self.globleNetWorkQueue release];
+
+ [super dealloc];
+}
+
+#pragma mark - Table view data source
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return 8;
+}
+
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ UITableViewCell *cell = nil;
+
+ if (cell == nil) {
+
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] autorelease];
+ cell.backgroundColor = self.tableView.backgroundColor;
+ cell.selectionStyle = UITableViewCellSelectionStyleBlue;
+
+ if (indexPath.row == 0) {
+ cell.textLabel.text = @"Create Bucket";
+ }else if (indexPath.row == 1) {
+ cell.textLabel.text = @"Delete Bucket";
+ }else if (indexPath.row == 2) {
+ cell.textLabel.text = @"List Buckets";
+ }else if (indexPath.row == 3) {
+ cell.textLabel.text = @"List Objects";
+ }else if (indexPath.row == 4) {
+ cell.textLabel.text = @"Upload Object";
+ }else if (indexPath.row == 5) {
+ cell.textLabel.text = @"Download Object";
+ }else if (indexPath.row == 6) {
+ cell.textLabel.text = @"Copy Object";
+ }else if (indexPath.row == 7) {
+ cell.textLabel.text = @"Delete Object";
+ }
+ }
+
+ return cell;
+}
+
+#pragma mark - Table view delegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
+
+ if (indexPath.row == 0) {
+
+ ASIS3BucketRequest *request = [ASIS3BucketRequest PUTRequestWithBucket:kUserTestBucketCreate];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"Create Bucket" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 1) {
+
+ ASIS3BucketRequest *request = [ASIS3BucketRequest DELETERequestWithBucket:kUserTestBucketCreate];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"Delete Bucket" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 2) {
+
+ ASIS3ServiceRequest *request = [ASIS3ServiceRequest serviceRequest];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"List Buckets" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 3) {
+
+ ASIS3BucketRequest *request = [ASIS3BucketRequest requestWithBucket:kUserTestBucketCreate];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"List Objects" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 4) {
+
+ NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"png"];
+ ASIS3ObjectRequest *request = [ASIS3ObjectRequest PUTRequestForFile:filePath
+ withBucket:kUserTestBucketCreate
+ key:[filePath lastPathComponent]];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"Upload Object" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 5) {
+
+ ASIS3ObjectRequest *request = [ASIS3ObjectRequest requestWithBucket:kUserTestBucketCreate key:@"test.png"];
+
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+ NSString *downloadPath = [NSString stringWithFormat:@"%@/test.png", documentsDirectory];
+ [request setDownloadDestinationPath:downloadPath];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"Download Object" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 6) {
+
+ ASIS3ObjectRequest *request = [ASIS3ObjectRequest COPYRequestFromBucket:kUserTestBucketCreate
+ key:@"test.png"
+ toBucket:kUserTestBucketCreate
+ key:@"test_copy.png"];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"Copy Object" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }else if (indexPath.row == 7) {
+
+ ASIS3ObjectRequest *request = [ASIS3ObjectRequest DELETERequestWithBucket:kUserTestBucketCreate key:@"test.png"];
+ [request setUserInfo:[NSDictionary dictionaryWithObject:@"Delete Object" forKey:@"requestKind"]];
+ [self.globleNetWorkQueue addOperation:request];
+
+ }
+
+ [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
+}
+
+
+#pragma - ASINetworkQueueDelegate
+
+- (void)requestDidFinished:(ASIS3Request *)request {
+
+ NSString *requestKind = [[request userInfo] valueForKey:@"requestKind"];
+
+ if ([requestKind isEqualToString:@"Create Bucket"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"创建成功" duration:1.5];
+ NSLog(@"%@ created", [(ASIS3BucketRequest *)request bucket]);
+ }
+
+ if ([requestKind isEqualToString:@"Delete Bucket"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"删除成功" duration:1.5];
+ NSLog(@"%@ deleted", [(ASIS3BucketRequest *)request bucket]);
+ }
+
+ if ([requestKind isEqualToString:@"List Buckets"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"列取成功" duration:1.5];
+
+ NSArray *buckets = [(ASIS3ServiceRequest *)request buckets];
+ NSLog(@"%@", buckets);
+ }
+
+ if ([requestKind isEqualToString:@"List Objects"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"列取成功" duration:1.5];
+
+ NSArray *objects = [(ASIS3BucketRequest *)request objects];
+ NSLog(@"%@", objects);
+ }
+
+ if ([requestKind isEqualToString:@"Upload Object"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"上传成功" duration:1.5];
+ NSLog(@"%@ uploaded", [(ASIS3ObjectRequest *)request key]);
+ }
+
+ if ([requestKind isEqualToString:@"Download Object"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"下载成功" duration:1.5];
+ NSLog(@"%@ downloaded", [(ASIS3ObjectRequest *)request key]);
+ NSLog(@"%@", [(ASIS3ObjectRequest *)request downloadDestinationPath]);
+ }
+
+ if ([requestKind isEqualToString:@"Copy Object"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"拷贝成功" duration:1.5];
+ NSLog(@"%@ copied to %@", [(ASIS3ObjectRequest *)request sourceKey], [(ASIS3ObjectRequest *)request key]);
+ }
+
+ if ([requestKind isEqualToString:@"Delete Object"]) {
+
+ [MBProgressHUD showSuccessHUDAddedTo:self.navigationController.view text:@"删除成功" duration:1.5];
+ NSLog(@"%@ deleted", [(ASIS3ObjectRequest *)request key]);
+ }
+
+ NSLog(@"===== <%@> finished", requestKind);
+}
+
+- (void)requestDidFailed:(ASIS3Request *)request {
+
+ NSString *requestKind = [[request userInfo] valueForKey:@"requestKind"];
+
+ if ([requestKind isEqualToString:@"Create Bucket"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"创建失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3BucketRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"Delete Bucket"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"删除失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3BucketRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"List Buckets"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"列取失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3ServiceRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"List Objects"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"列取失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3BucketRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"Upload Object"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"上传失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3ObjectRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"Download Object"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"下载失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3ObjectRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"Copy Object"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"拷贝失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3ObjectRequest *)request error]);
+ }
+
+ if ([requestKind isEqualToString:@"Delete Object"]) {
+
+ [MBProgressHUD showErrorHUDAddedTo:self.navigationController.view text:@"删除失败" duration:1.5];
+ NSLog(@"%@", [(ASIS3ObjectRequest *)request error]);
+ }
+
+ NSLog(@"===== <%@> failed", requestKind);
+}
+
+- (void)requestDidReceivedResponseHeaders:(ASIS3Request *)request {
+
+}
+
+- (void)requestDidStarted:(ASIS3Request *)request {
+
+ NSString *requestKind = [[request userInfo] valueForKey:@"requestKind"];
+ NSLog(@"===== <%@> started", requestKind);
+}
+
+- (void)requestWillRedirect:(ASIS3Request *)request {
+
+}
+
+@end
diff --git a/SCS-iOS-Demo/SCS-iOS-Demo-Info.plist b/SCS-iOS-Demo/SCS-iOS-Demo-Info.plist
new file mode 100644
index 00000000..70dc7a8b
--- /dev/null
+++ b/SCS-iOS-Demo/SCS-iOS-Demo-Info.plist
@@ -0,0 +1,38 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ ${PRODUCT_NAME}
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIdentifier
+ com.sina.${PRODUCT_NAME:rfc1034identifier}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ LSRequiresIPhoneOS
+
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch b/SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch
new file mode 100644
index 00000000..743435c9
--- /dev/null
+++ b/SCS-iOS-Demo/SCS-iOS-Demo-Prefix.pch
@@ -0,0 +1,16 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#import
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import
+ #import
+#endif
diff --git a/SCS-iOS-Demo/en.lproj/InfoPlist.strings b/SCS-iOS-Demo/en.lproj/InfoPlist.strings
new file mode 100644
index 00000000..477b28ff
--- /dev/null
+++ b/SCS-iOS-Demo/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/SCS-iOS-Demo/main.m b/SCS-iOS-Demo/main.m
new file mode 100644
index 00000000..d348bde4
--- /dev/null
+++ b/SCS-iOS-Demo/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// SCS-iOS-Demo
+//
+// Created by Littlebox222 on 14-8-14.
+// Copyright (c) 2014年 Littlebox222. All rights reserved.
+//
+
+#import
+
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
diff --git a/SCS-iOS-Demo/test.png b/SCS-iOS-Demo/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..59e7f554f5042068e35cbfb6e38615369cedb688
GIT binary patch
literal 8708
zcmZX21yEhhvhF4jAUMHYHWp;#?(XjH?(Xgzg1c*QcXtRL2oAw5xVv2bbMHInRJ~O-
zYt3}`*FD`cHPgK!739Pb;c(#q005$-gox6|H~FK{!hZUA?|il`1_0oCEro>@B!z{E
z6`btNENx5y013pZ6n7QnQLK@Ju2emXKv;<{U6SX-U16jWFnAW+hGsmIziYV)tW1If=Gvp3%EGo8)$6S>{b*4W#er?3E0
zFw#^qp?d%cG!t1FaR9)S7;-ldIx3sw1{M+V)BDQ$26UXs<&QG5g`W1;
z^Ut10?7@ftbTEk0foaK-Dp$mtK$~g|3J@uH%C(#>^yQ$il1d0o#IqwL(X36b|4YLf
z+YTD)e(2K;Kp?MHqks(X(_N7p7?m9|OyV!HEY!ON56HtVI2qfoeMuSj1GPVlQ+rtzIW$ItqNr02|X^v|U~<&5TL9#J-#n}kZ=
zn}JD-?o8AIiuBB1LeukSxgmT|5Htd^M<)f35dbyG{W_@pk*T8>0{YOYedx85m<*M)
zw6=h_PUc8tfc;0x~eYHUP>bkW>KzR{#e4ld{3*lK^H17(QY^NB}Gfd9>m(d-;CXy-h#O(e29f&5==A@
zy&xY%g$h9oVd^*R*X##u;TVFc#OHuqsKOEWMj%JLx|k)oPC^oiRFcd}7@~gcSY-R0`4G^pc9v8BJ-5b7m#m#66{p
zm2S(<<~Xb?s+G