dnorris707 dnorris707 - 5 months ago 40
iOS Question

Amazon web services AmazonS3Client alloc giving error

I'm trying to learn how to use the

AWS S3 SDK
and thought uploading an image would be a good place to start(the tutorial is through Amazon). I used the exact code they supplied:

AmazonS3Client *s3 =
[[[AmazonS3Client alloc] initWithAccessKey:MY_ACCESS_KEY_ID withSecretKey:MY_SECRET_KEY] autorelease];


But for some reason,
Xcode
doesn't have the
alloc
available for the
AmazonS3Client
. I've googled and searched through the forums and not found much so it's not a common problem. Anyone else having this issue and fixed it?

Answer

just write the code autorelease has deprecated in iOS 6

AmazonS3Client *s3 = [[AmazonS3Client alloc] initWithAccessKey:MY_ACCESS_KEY_ID withSecretKey:MY_SECRET_KEY]; 

you were imported

#import <AWSS3/AWSS3.h>
#import <AWSRuntime/AWSRuntime.h>

and call the .h file

@interface ArtistProfileViewController : UIViewController<AmazonServiceRequestDelegate>

enter image description here