I use the AWS SDK for iOS to upload and download files from the local hard drive to and from the local Amazon S3 drive. I can do this work, but I can’t get the S3 delegate to respond correctly in order to warn me of an operation being completed or an error.
I have an array of files that I want to upload. For each file, I create NSOperationwhere the procedure mainconsists mainly of:
AmazonCredentials * credentials = [[AmazonCredentials alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
putObjectRequest = [[S3PutObjectRequest alloc] initWithKey:pathCopy inBucket:[self bucket]];
putObjectRequest.filename = pathSource;
putObjectRequest.credentials=credentials;
[putObjectRequest setDelegate:s3Delegate];
Here, the delegate ( s3Delegate) is created as a regular AmazonServiceRequestDelegate , which should be able to turn off responses when the operation is completed. Each of mine is NSOperationsadded to mine NSOperationQueue, which does not perform operations simultaneously. If I use a delegate [putObjectRequest setDelegate:s3Delegate], operations do not work. If I remove the use of the delegate, the operations will be performed correctly, but I can not get answers to the operations, because I do not have a delegate.
If I completely remove the use NSOperationQueueand use [putObjectRequest setDelegate:s3Delegate], the delegate works fine.
, ? , , , ? , . , - , , - . !
Cheers, Trond