我正在使用运行良好的 iOS SDK 上传到 Amazon S3,但我希望能够在加载完成时触发一个方法。
这是我的代码:
AmazonS3Client *s3 = [[[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY] autorelease];
// Create the picture bucket.
[s3 createBucket:[[[S3CreateBucketRequest alloc] initWithName:[Constants pictureBucket]] autorelease]];
NSString *picName = [NSString stringWithFormat:@"%@%d", PICTURE_NAME, counter];
// Upload image data. Remember to set the content type.
S3PutObjectRequest *por = [[[S3PutObjectRequest alloc] initWithKey:picName inBucket:[Constants pictureBucket]] autorelease];
NSLog(@"------------ SUBMITTING img :%@", picName);
por.contentType = @"image/jpeg";
por.data = imageData;
counter++;
// Put the image data into the specified s3 bucket and object.
[s3 putObject:por];
任何帮助都非常感谢!