Bug fixes (network requests continue on background threads, CMISDateUtil was not thread safe, title element not XML escaped), code tidy and fixed typos.
Build also now produces a debug and release static library (release build no longer contains debug symbols).
git-svn-id: https://svn.apache.org/repos/asf/chemistry/objectivecmis/trunk@1575945 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ObjectiveCMIS.xcodeproj/project.pbxproj b/ObjectiveCMIS.xcodeproj/project.pbxproj
index 24d0667..9db267b 100644
--- a/ObjectiveCMIS.xcodeproj/project.pbxproj
+++ b/ObjectiveCMIS.xcodeproj/project.pbxproj
@@ -947,7 +947,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# [JORAM] Added check for variable: when running a regular build in XCode, this causes not to trigger the universal lib building.\n\necho \"BUILD_UNIVERSAL_LIB = $BUILD_UNIVERSAL_LIB\"\nif [ -z $BUILD_UNIVERSAL_LIB ]\nthen\necho \"Not building universal lib\"\nexit 0\nelse\necho \"Building universal lib\"\nfi\n\n# --------------------------------------------------------------------------------------------------------------------------------------------------------\n#\n# Following code is integral from http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4\n#\n# Version 2.0 (updated for Xcode 4, with some fixes)\n# Changes:\n# - Works with xcode 4, even when running xcode 3 projects (Workarounds for apple bugs)\n# - Faster / better: only runs lipo once, instead of once per recursion\n# - Added some debugging statemetns that can be switched on/off by changing the DEBUG_THIS_SCRIPT variable to \"true\"\n# - Fixed some typos\n# \n# Purpose:\n# Create a static library for iPhone from within XCode\n# Because Apple staff DELIBERATELY broke Xcode to make this impossible from the GUI (Xcode 3.2.3 specifically states this in the Release notes!)\n# ...no, I don't understand why they did this!\n#\n# Author: Adam Martin - http://twitter.com/redglassesapps\n# Based on: original script from Eonil (main changes: Eonil's script WILL NOT WORK in Xcode GUI - it WILL CRASH YOUR COMPUTER)\n#\n# More info: see this Stack Overflow question: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4\n\n#################[ Tests: helps workaround any future bugs in Xcode ]########\n#\nDEBUG_THIS_SCRIPT=\"true\"\n\nif [ $DEBUG_THIS_SCRIPT = \"true\" ]\nthen\necho \"########### TESTS #############\"\necho \"Use the following variables when debugging this script; note that they may change on recursions\"\necho \"BUILD_DIR = $BUILD_DIR\"\necho \"BUILD_ROOT = $BUILD_ROOT\"\necho \"CONFIGURATION_BUILD_DIR = $CONFIGURATION_BUILD_DIR\"\necho \"BUILT_PRODUCTS_DIR = $BUILT_PRODUCTS_DIR\"\necho \"CONFIGURATION_TEMP_DIR = $CONFIGURATION_TEMP_DIR\"\necho \"TARGET_BUILD_DIR = $TARGET_BUILD_DIR\"\nfi\n\n#####################[ part 1 ]##################\n# First, work out the BASESDK version number (NB: Apple ought to report this, but they hide it)\n# (incidental: searching for substrings in sh is a nightmare! Sob)\n\nSDK_VERSION=$(echo ${SDK_NAME} | grep -o '.\\{3\\}$')\n\n# Next, work out if we're in SIM or DEVICE\n\nif [ ${PLATFORM_NAME} = \"iphonesimulator\" ]\nthen\nOTHER_SDK_TO_BUILD=iphoneos${SDK_VERSION}\nelse\nOTHER_SDK_TO_BUILD=iphonesimulator${SDK_VERSION}\nfi\n\necho \"XCode has selected SDK: ${PLATFORM_NAME} with version: ${SDK_VERSION} (although back-targetting: ${IPHONEOS_DEPLOYMENT_TARGET})\"\necho \"...therefore, OTHER_SDK_TO_BUILD = ${OTHER_SDK_TO_BUILD}\"\n#\n#####################[ end of part 1 ]##################\n\n#####################[ part 2 ]##################\n#\n# IF this is the original invocation, invoke WHATEVER other builds are required\n#\n# Xcode is already building ONE target...\n#\n# ...but this is a LIBRARY, so Apple is wrong to set it to build just one.\n# ...we need to build ALL targets\n# ...we MUST NOT re-build the target that is ALREADY being built: Xcode WILL CRASH YOUR COMPUTER if you try this (infinite recursion!)\n#\n#\n# So: build ONLY the missing platforms/configurations.\n\nif [ \"true\" == ${ALREADYINVOKED:-false} ]\nthen\necho \"RECURSION: I am NOT the root invocation, so I'm NOT going to recurse\"\nelse\n# CRITICAL:\n# Prevent infinite recursion (Xcode sucks)\nexport ALREADYINVOKED=\"true\"\n\necho \"RECURSION: I am the root ... recursing all missing build targets NOW...\"\necho \"RECURSION: ...about to invoke: xcodebuild -configuration \\\"${CONFIGURATION}\\\" -target \\\"${TARGET_NAME}\\\" -sdk \\\"${OTHER_SDK_TO_BUILD}\\\" ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO\"\nxcodebuild -configuration \"${CONFIGURATION}\" -target \"${TARGET_NAME}\" -sdk \"${OTHER_SDK_TO_BUILD}\" ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\n\nACTION=\"build\"\n\n#Merge all platform binaries as a fat binary for each configurations.\n\n# Calculate where the (multiple) built files are coming from:\nCURRENTCONFIG_DEVICE_DIR=${SYMROOT}/${CONFIGURATION}-iphoneos\nCURRENTCONFIG_SIMULATOR_DIR=${SYMROOT}/${CONFIGURATION}-iphonesimulator\n\necho \"Taking device build from: ${CURRENTCONFIG_DEVICE_DIR}\"\necho \"Taking simulator build from: ${CURRENTCONFIG_SIMULATOR_DIR}\"\n\nCREATING_UNIVERSAL_DIR=${SYMROOT}/${CONFIGURATION}-universal\necho \"\"\necho \"...I will output a universal build to: ${CREATING_UNIVERSAL_DIR}\"\necho \"\"\n\n# ... remove the products of previous runs of this script\n# NB: this directory is ONLY created by this script - it should be safe to delete!\n\nrm -rf \"${CREATING_UNIVERSAL_DIR}\"\nmkdir \"${CREATING_UNIVERSAL_DIR}\"\n\n#\necho \"lipo: for current configuration (${CONFIGURATION}) creating output file: ${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}\"\nlipo -create -output \"${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}\" \"${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}\" \"${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}\"\n\n#########\n#\n# Added: StackOverflow suggestion to also copy \"include\" files\n# (untested, but should work OK)\n#\nif [ -d \"${CURRENTCONFIG_DEVICE_DIR}/ObjectiveCMIS\" ]\nthen\nmkdir -p \"${CREATING_UNIVERSAL_DIR}/ObjectiveCMIS\"\n#mkdir -p \"${CREATING_UNIVERSAL_DIR}/usr/local/include\"\n# * needs to be outside the double quotes?\ncp \"${CURRENTCONFIG_DEVICE_DIR}/ObjectiveCMIS/\"* \"${CREATING_UNIVERSAL_DIR}/ObjectiveCMIS\"\nfi\nfi\n\n";
+ shellScript = "# [JORAM] Added check for variable: when running a regular build in XCode, this causes not to trigger the universal lib building.\n\necho \"BUILD_UNIVERSAL_LIB = $BUILD_UNIVERSAL_LIB\"\nif [ -z $BUILD_UNIVERSAL_LIB ]\nthen\necho \"Not building universal lib\"\nexit 0\nelse\necho \"Building universal lib\"\nfi\n\n# --------------------------------------------------------------------------------------------------------------------------------------------------------\n#\n# Following code is integral from http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4\n#\n# Version 2.0 (updated for Xcode 4, with some fixes)\n# Changes:\n# - Works with xcode 4, even when running xcode 3 projects (Workarounds for apple bugs)\n# - Faster / better: only runs lipo once, instead of once per recursion\n# - Added some debugging statemetns that can be switched on/off by changing the DEBUG_THIS_SCRIPT variable to \"true\"\n# - Fixed some typos\n# \n# Purpose:\n# Create a static library for iPhone from within XCode\n# Because Apple staff DELIBERATELY broke Xcode to make this impossible from the GUI (Xcode 3.2.3 specifically states this in the Release notes!)\n# ...no, I don't understand why they did this!\n#\n# Author: Adam Martin - http://twitter.com/redglassesapps\n# Based on: original script from Eonil (main changes: Eonil's script WILL NOT WORK in Xcode GUI - it WILL CRASH YOUR COMPUTER)\n#\n# More info: see this Stack Overflow question: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4\n\n#################[ Tests: helps workaround any future bugs in Xcode ]########\n#\nDEBUG_THIS_SCRIPT=\"true\"\n\nif [ $DEBUG_THIS_SCRIPT = \"true\" ]\nthen\necho \"########### TESTS #############\"\necho \"Use the following variables when debugging this script; note that they may change on recursions\"\necho \"BUILD_DIR = $BUILD_DIR\"\necho \"BUILD_ROOT = $BUILD_ROOT\"\necho \"CONFIGURATION_BUILD_DIR = $CONFIGURATION_BUILD_DIR\"\necho \"BUILT_PRODUCTS_DIR = $BUILT_PRODUCTS_DIR\"\necho \"CONFIGURATION_TEMP_DIR = $CONFIGURATION_TEMP_DIR\"\necho \"TARGET_BUILD_DIR = $TARGET_BUILD_DIR\"\nfi\n\n#####################[ part 1 ]##################\n# First, work out the BASESDK version number (NB: Apple ought to report this, but they hide it)\n# (incidental: searching for substrings in sh is a nightmare! Sob)\n\nSDK_VERSION=$(echo ${SDK_NAME} | grep -o '.\\{3\\}$')\n\n# Next, work out if we're in SIM or DEVICE\n\nif [ ${PLATFORM_NAME} = \"iphonesimulator\" ]\nthen\nOTHER_SDK_TO_BUILD=iphoneos${SDK_VERSION}\nelse\nOTHER_SDK_TO_BUILD=iphonesimulator${SDK_VERSION}\nfi\n\necho \"XCode has selected SDK: ${PLATFORM_NAME} with version: ${SDK_VERSION} (although back-targetting: ${IPHONEOS_DEPLOYMENT_TARGET})\"\necho \"...therefore, OTHER_SDK_TO_BUILD = ${OTHER_SDK_TO_BUILD}\"\n#\n#####################[ end of part 1 ]##################\n\n#####################[ part 2 ]##################\n#\n# IF this is the original invocation, invoke WHATEVER other builds are required\n#\n# Xcode is already building ONE target...\n#\n# ...but this is a LIBRARY, so Apple is wrong to set it to build just one.\n# ...we need to build ALL targets\n# ...we MUST NOT re-build the target that is ALREADY being built: Xcode WILL CRASH YOUR COMPUTER if you try this (infinite recursion!)\n#\n#\n# So: build ONLY the missing platforms/configurations.\n\nif [ \"true\" == ${ALREADYINVOKED:-false} ]\nthen\necho \"RECURSION: I am NOT the root invocation, so I'm NOT going to recurse\"\nelse\n# CRITICAL:\n# Prevent infinite recursion (Xcode sucks)\nexport ALREADYINVOKED=\"true\"\n\necho \"RECURSION: I am the root ... recursing all missing build targets NOW...\"\necho \"RECURSION: ...about to invoke: xcodebuild -configuration \\\"${CONFIGURATION}\\\" -target \\\"${TARGET_NAME}\\\" -sdk \\\"${OTHER_SDK_TO_BUILD}\\\" clean ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO\"\nxcodebuild -configuration \"${CONFIGURATION}\" -target \"${TARGET_NAME}\" -sdk \"${OTHER_SDK_TO_BUILD}\" clean ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\n\nACTION=\"build\"\n\n#Merge all platform binaries as a fat binary for each configurations.\n\n# Calculate where the (multiple) built files are coming from:\nCURRENTCONFIG_DEVICE_DIR=${SYMROOT}/${CONFIGURATION}-iphoneos\nCURRENTCONFIG_SIMULATOR_DIR=${SYMROOT}/${CONFIGURATION}-iphonesimulator\n\necho \"Taking device build from: ${CURRENTCONFIG_DEVICE_DIR}\"\necho \"Taking simulator build from: ${CURRENTCONFIG_SIMULATOR_DIR}\"\n\nCREATING_UNIVERSAL_DIR=${SYMROOT}/${CONFIGURATION}-universal\necho \"\"\necho \"...I will output a universal build to: ${CREATING_UNIVERSAL_DIR}\"\necho \"\"\n\n# ... remove the products of previous runs of this script\n# NB: this directory is ONLY created by this script - it should be safe to delete!\n\nrm -rf \"${CREATING_UNIVERSAL_DIR}\"\nmkdir \"${CREATING_UNIVERSAL_DIR}\"\n\n# [MIKEH] Rename universal library depending on build configuration type\nif [ ${CONFIGURATION} = \"Debug\" ]\nthen\nUNIVERSAL_FILE=${EXECUTABLE_NAME%.a}-debug.a\nelse\nUNIVERSAL_FILE=${EXECUTABLE_NAME}\nfi\n\n#\necho \"lipo: for current configuration (${CONFIGURATION}) creating output file: ${CREATING_UNIVERSAL_DIR}/${UNIVERSAL_FILE}\"\nlipo -create -output \"${CREATING_UNIVERSAL_DIR}/${UNIVERSAL_FILE}\" \"${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}\" \"${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}\"\n\n#########\n#\n# Added: StackOverflow suggestion to also copy \"include\" files\n# (untested, but should work OK)\n#\nif [ -d \"${CURRENTCONFIG_DEVICE_DIR}/ObjectiveCMIS\" ]\nthen\nmkdir -p \"${CREATING_UNIVERSAL_DIR}/ObjectiveCMIS\"\n#mkdir -p \"${CREATING_UNIVERSAL_DIR}/usr/local/include\"\n# * needs to be outside the double quotes?\ncp \"${CURRENTCONFIG_DEVICE_DIR}/ObjectiveCMIS/\"* \"${CREATING_UNIVERSAL_DIR}/ObjectiveCMIS\"\nfi\nfi\n\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -1135,6 +1135,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
diff --git a/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m b/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m
index 91f2f22..c14ab84 100644
--- a/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m
+++ b/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m
@@ -78,7 +78,7 @@
// Determine format of title element depending on nil status of namePropertyValue
if (nil != namePropertyValue)
{
- startElement = [startElement stringByAppendingFormat:@"<title>%@</title>", namePropertyValue];
+ startElement = [startElement stringByAppendingFormat:@"<title>%@</title>", [namePropertyValue stringByAddingXMLEntities]];
}
else
{
diff --git a/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h b/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h
index 931743a..e8c050c 100644
--- a/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h
+++ b/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h
@@ -26,7 +26,7 @@
@protocol CMISRepositoryInfoParserDelegate <NSObject>
@required
/// parses repository info delegate method
-- (void)repositoryInfoParser:(CMISRepositoryInfoParser *)epositoryInfoParser didFinishParsingRepositoryInfo:(CMISRepositoryInfo *)repositoryInfo;
+- (void)repositoryInfoParser:(CMISRepositoryInfoParser *)repositoryInfoParser didFinishParsingRepositoryInfo:(CMISRepositoryInfo *)repositoryInfo;
@end
diff --git a/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h b/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h
index 1dffeb4..636c959 100644
--- a/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h
+++ b/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h
@@ -26,7 +26,7 @@
@interface CMISAtomPubBaseService (Protected)
/** retrieve object from cache
- * completionBlock returns the object (as id) or nil if unsuccessul
+ * completionBlock returns the object (as id) or nil if unsuccessful
*/
- (void)retrieveFromCache:(NSString *)cacheKey
cmisRequest:(CMISRequest *)cmisRequest
@@ -51,7 +51,7 @@
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
/** Full-blown object retrieval version
- * completionBlock returns CMISObjectData instance or nil if unsuccessul
+ * completionBlock returns CMISObjectData instance or nil if unsuccessful
*/
- (void)retrieveObjectInternal:(NSString *)objectId
returnVersion:(CMISReturnVersion)cmisReturnVersion
@@ -65,7 +65,7 @@
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
/** retrieve object for a given path name
- * completionBlock returns CMISObjectData instance or nil if unsuccessul
+ * completionBlock returns CMISObjectData instance or nil if unsuccessful
*/
- (void)retrieveObjectByPathInternal:(NSString *)path
filter:(NSString *)filter
diff --git a/ObjectiveCMIS/Bindings/CMISQueryResult.h b/ObjectiveCMIS/Bindings/CMISQueryResult.h
index 5fb2f3a..626b579 100644
--- a/ObjectiveCMIS/Bindings/CMISQueryResult.h
+++ b/ObjectiveCMIS/Bindings/CMISQueryResult.h
@@ -38,7 +38,7 @@
- (id)initWithCmisObjectData:(CMISObjectData *)cmisObjectData session:(CMISSession *)session;
/**
- * Convience method for the initializer.
+ * Convenience method for the initializer.
*/
+ (CMISQueryResult *)queryResultUsingCmisObjectData:(CMISObjectData *)cmisObjectData session:(CMISSession *)session;
diff --git a/ObjectiveCMIS/Client/CMISDocument.h b/ObjectiveCMIS/Client/CMISDocument.h
index 8705fea..502ceba 100644
--- a/ObjectiveCMIS/Client/CMISDocument.h
+++ b/ObjectiveCMIS/Client/CMISDocument.h
@@ -48,13 +48,13 @@
- (CMISRequest*)retrieveAllVersionsWithOperationContext:(CMISOperationContext *)operationContext completionBlock:(void (^)(CMISCollection *collection, NSError *error))completionBlock;
/**
- * Retrieves the lastest version of this document.
+ * Retrieves the latest version of this document.
* The completionBlock returns the CMIS document or nil if unsuccessful
*/
- (CMISRequest*)retrieveObjectOfLatestVersionWithMajorVersion:(BOOL)major completionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock;
/**
- * Retrieves the lastest version of this document with paging options.
+ * Retrieves the latest version of this document with paging options.
* The completionBlock returns the CMIS document or nil if unsuccessful
*/
- (CMISRequest*)retrieveObjectOfLatestVersionWithMajorVersion:(BOOL)major
diff --git a/ObjectiveCMIS/Client/CMISDocument.m b/ObjectiveCMIS/Client/CMISDocument.m
index b1612ff..77fc51e 100644
--- a/ObjectiveCMIS/Client/CMISDocument.m
+++ b/ObjectiveCMIS/Client/CMISDocument.m
@@ -49,7 +49,7 @@
{
self = [super initWithObjectData:objectData session:session];
if (self){
- self.contentStreamId = [[objectData.properties.propertiesDictionary objectForKey:kCMISProperyContentStreamId] firstValue];
+ self.contentStreamId = [[objectData.properties.propertiesDictionary objectForKey:kCMISPropertyContentStreamId] firstValue];
self.contentStreamMediaType = [[objectData.properties.propertiesDictionary objectForKey:kCMISPropertyContentStreamMediaType] firstValue];
self.contentStreamLength = [[[objectData.properties.propertiesDictionary objectForKey:kCMISPropertyContentStreamLength] firstValue] unsignedLongLongValue];
self.contentStreamFileName = [[objectData.properties.propertiesDictionary objectForKey:kCMISPropertyContentStreamFileName] firstValue];
diff --git a/ObjectiveCMIS/Client/CMISSession.m b/ObjectiveCMIS/Client/CMISSession.m
index bd871e5..dc10758 100644
--- a/ObjectiveCMIS/Client/CMISSession.m
+++ b/ObjectiveCMIS/Client/CMISSession.m
@@ -252,7 +252,6 @@
}];
} else {
if (error == nil) {
- NSError *error = [[NSError alloc] init];
error = [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeObjectNotFound];
}
completionBlock(nil, error);
diff --git a/ObjectiveCMIS/Common/CMISConstants.h b/ObjectiveCMIS/Common/CMISConstants.h
index 3345e81..1b1a5db 100644
--- a/ObjectiveCMIS/Common/CMISConstants.h
+++ b/ObjectiveCMIS/Common/CMISConstants.h
@@ -27,7 +27,7 @@
extern NSString * const kCMISPropertyCreationDate;
extern NSString * const kCMISPropertyModifiedBy;
extern NSString * const kCMISPropertyModificationDate;
-extern NSString * const kCMISProperyContentStreamId;
+extern NSString * const kCMISPropertyContentStreamId;
extern NSString * const kCMISPropertyContentStreamFileName;
extern NSString * const kCMISPropertyContentStreamLength;
extern NSString * const kCMISPropertyContentStreamMediaType;
diff --git a/ObjectiveCMIS/Common/CMISConstants.m b/ObjectiveCMIS/Common/CMISConstants.m
index 49c707c..48ebe27 100644
--- a/ObjectiveCMIS/Common/CMISConstants.m
+++ b/ObjectiveCMIS/Common/CMISConstants.m
@@ -28,7 +28,7 @@
NSString * const kCMISPropertyCreationDate = @"cmis:creationDate";
NSString * const kCMISPropertyModifiedBy = @"cmis:lastModifiedBy";
NSString * const kCMISPropertyModificationDate = @"cmis:lastModificationDate";
-NSString * const kCMISProperyContentStreamId = @"cmis:contentStreamId";
+NSString * const kCMISPropertyContentStreamId = @"cmis:contentStreamId";
NSString * const kCMISPropertyContentStreamFileName = @"cmis:contentStreamFileName";
NSString * const kCMISPropertyContentStreamLength = @"cmis:contentStreamLength";
NSString * const kCMISPropertyContentStreamMediaType = @"cmis:contentStreamMimeType";
diff --git a/ObjectiveCMIS/Common/CMISNetworkProvider.h b/ObjectiveCMIS/Common/CMISNetworkProvider.h
index 6534691..28be679 100644
--- a/ObjectiveCMIS/Common/CMISNetworkProvider.h
+++ b/ObjectiveCMIS/Common/CMISNetworkProvider.h
@@ -102,7 +102,7 @@
* @param inputStream the stream pointing to the source to be uploaded. Must be an instance or extension of NSInputStream
* @param headers any additional headers to be used in the request (maybe nil)
* @param bytesExpected the size of the content to be uploaded
- * @param cmisRequest will be used to set the cancellable request to the one created by the invode method
+ * @param cmisRequest will be used to set the cancellable request to the one created by the invoked method
* @param cmisProperties
* @param mimeType
* @param completionBlock returns an instance of the HTTPResponse if successful or nil otherwise
diff --git a/ObjectiveCMIS/Utils/CMISDateUtil.m b/ObjectiveCMIS/Utils/CMISDateUtil.m
index 656fce1..83a3f7d 100644
--- a/ObjectiveCMIS/Utils/CMISDateUtil.m
+++ b/ObjectiveCMIS/Utils/CMISDateUtil.m
@@ -23,29 +23,47 @@
#import "CMISDateUtil.h"
#import "CMISLog.h"
+static const NSString *kDateFormatterKey = @"CMISDateFormatter";
+static const NSString *kCalendarKey = @"CMISCalendar";
+
@implementation CMISDateUtil
+ (NSDateFormatter *)CMISDateFormatter
{
- static dispatch_once_t predicate = 0;
- __strong static NSDateFormatter *dateFormatter = nil;
- dispatch_once(&predicate, ^ {
- dateFormatter = [[NSDateFormatter alloc] init];
- dateFormatter.locale = [NSLocale systemLocale];
- dateFormatter.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; // ISO8601 calendar not available
- NSTimeZone *timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
- dateFormatter.calendar.timeZone = timeZone;
- dateFormatter.timeZone = timeZone;
- dateFormatter.dateFormat = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'";
- });
- return dateFormatter;
+ NSMutableDictionary *threadDictionary = [[NSThread currentThread] threadDictionary];
+ NSDateFormatter *dateFormatter = [threadDictionary objectForKey:kDateFormatterKey];
+ if (dateFormatter == nil) {
+ dateFormatter = [[NSDateFormatter alloc] init];
+ dateFormatter.locale = [NSLocale systemLocale];
+ dateFormatter.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; // ISO8601 calendar not available
+ NSTimeZone *timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
+ dateFormatter.calendar.timeZone = timeZone;
+ dateFormatter.timeZone = timeZone;
+ dateFormatter.dateFormat = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'";
+
+ [threadDictionary setObject:dateFormatter forKey:kDateFormatterKey];
+ }
+ return dateFormatter;
+}
+
++ (NSCalendar *)CMISCalendar
+{
+ NSMutableDictionary *threadDictionary = [[NSThread currentThread] threadDictionary];
+ NSCalendar *calendar = [threadDictionary objectForKey:kCalendarKey];
+ if (calendar == nil) {
+ calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; // ISO8601 calendar not available
+ calendar.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; // default for formats without time
+
+ [threadDictionary setObject:calendar forKey:kCalendarKey];
+ }
+
+ return calendar;
}
-+ (NSString*)stringFromDate:(NSDate*)date
++ (NSString *)stringFromDate:(NSDate *)date
{
- NSString *string = [[CMISDateUtil CMISDateFormatter] stringFromDate:date];
- return string;
+ return [[CMISDateUtil CMISDateFormatter] stringFromDate:date];
}
@@ -141,7 +159,7 @@
if (![scanner scanString:@":" intoString:nil]) {
tzMinute = 0;
}
- else{
+ else {
if (![scanner scanInteger:&tzMinute]) {
CMISLogDebug(@"No timezone minute found in time string '%@'", string);
return nil;
@@ -161,14 +179,7 @@
return nil;
}
- static NSCalendar *gregorianCalendar = nil;
- if (gregorianCalendar == nil) {
- gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; // ISO8601 calendar not available
- gregorianCalendar.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; // default for formats without time
- }
-
- NSDate *date = [gregorianCalendar dateFromComponents:components];
- return date;
+ return [[CMISDateUtil CMISCalendar] dateFromComponents:components];
}
diff --git a/ObjectiveCMIS/Utils/CMISHttpRequest.m b/ObjectiveCMIS/Utils/CMISHttpRequest.m
index e8279a5..c79f931 100644
--- a/ObjectiveCMIS/Utils/CMISHttpRequest.m
+++ b/ObjectiveCMIS/Utils/CMISHttpRequest.m
@@ -93,8 +93,10 @@
[urlRequest addValue:header forHTTPHeaderField:headerName];
}];
- self.connection = [NSURLConnection connectionWithRequest:urlRequest delegate:self];
+ self.connection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:NO];
if (self.connection) {
+ [self.connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
+ [self.connection start];
return YES;
} else {
if (self.completionBlock) {
@@ -168,7 +170,6 @@
}
self.completionBlock = nil;
-
self.connection = nil;
}
@@ -188,7 +189,6 @@
}
self.completionBlock = nil;
-
self.connection = nil;
}
@@ -274,9 +274,8 @@
}
}
return NO;
- } else {
- return YES;
}
+ return YES;
}
@end
diff --git a/ObjectiveCMIS/Utils/CMISHttpUploadRequest.h b/ObjectiveCMIS/Utils/CMISHttpUploadRequest.h
index 0f473c7..921e16d 100644
--- a/ObjectiveCMIS/Utils/CMISHttpUploadRequest.h
+++ b/ObjectiveCMIS/Utils/CMISHttpUploadRequest.h
@@ -25,14 +25,14 @@
@property (nonatomic, readonly) unsigned long long bytesUploaded;
/**
- * starts a URL request with a provided input stream. The input stream provided will be used directly to send the data upstrean.
+ * starts a URL request with a provided input stream. The input stream provided will be used directly to send the data upstream.
* For this the class sets the HTTPBodyStream property (method) to this input stream. No base64 encoding will be done using this method.
* completionBlock returns CMISHttpResponse instance or nil if unsuccessful
*/
+ (id)startRequest:(NSMutableURLRequest *)urlRequest
httpMethod:(CMISHttpRequestMethod)httpRequestMethod
inputStream:(NSInputStream*)inputStream
- headers:(NSDictionary*)addionalHeaders
+ headers:(NSDictionary*)additionalHeaders
bytesExpected:(unsigned long long)bytesExpected
authenticationProvider:(id<CMISAuthenticationProvider>) authenticationProvider
completionBlock:(void (^)(CMISHttpResponse *httpResponse, NSError *error))completionBlock
@@ -48,7 +48,7 @@
+ (id)startRequest:(NSMutableURLRequest *)urlRequest
httpMethod:(CMISHttpRequestMethod)httpRequestMethod
inputStream:(NSInputStream*)sourceInputStream
- headers:(NSDictionary*)addionalHeaders
+ headers:(NSDictionary*)additionalHeaders
bytesExpected:(unsigned long long)bytesExpected
authenticationProvider:(id<CMISAuthenticationProvider>) authenticationProvider
cmisProperties:(CMISProperties *)cmisProperties
diff --git a/ObjectiveCMIS/Utils/CMISLog.h b/ObjectiveCMIS/Utils/CMISLog.h
index a0caf55..06ee6fd 100644
--- a/ObjectiveCMIS/Utils/CMISLog.h
+++ b/ObjectiveCMIS/Utils/CMISLog.h
@@ -16,7 +16,7 @@
* Default logging level
*
* The default logging level is Info for release builds and Debug for debug builds.
- * This can easily be overriden in your app's .pch file, e.g.
+ * This can easily be overridden in your app's .pch file, e.g.
* #define CMIS_LOG_LEVEL CMISLogLevelTrace
*/
#if !defined(CMISLogError)
diff --git a/release.sh b/release.sh
index 6381ed9..efe5f36 100755
--- a/release.sh
+++ b/release.sh
@@ -81,9 +81,10 @@
BUILD_UNIVERSAL_LIB='TRUE'
export BUILD_UNIVERSAL_LIB
xcodebuild -project ObjectiveCMIS.xcodeproj -target ObjectiveCMIS -configuration Debug clean build
+xcodebuild -project ObjectiveCMIS.xcodeproj -target ObjectiveCMIS -configuration Release clean build
cp -R build/Debug-universal/* release-pack/bin
-
+cp build/Release-universal/*.a release-pack/bin
echo "Creating package..."