I am fairly new to Swift programming, and new to developing a mobile application in general. I tried to follow the following getting started guide here: http://ift.tt/1w95v0t
What I am currently attempting to do is create the component of my application which creates user accounts, and allows users to log in.
I have followed the ReadMe, but when I get to the following portion of code to make a call to AWS:
let credentialsProvider = AWSCognitoCredentialsProvider(
regionType: CognitoRegionType,
identityPoolId: CognitoIdentityPoolId)
let configuration = AWSServiceConfiguration(
region: DefaultServiceRegionType,
credentialsProvider: credentialsProvider)
AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration
let dynamoDB = AWSDynamoDB.defaultDynamoDB()
let listTableInput = AWSDynamoDBListTablesInput()
dynamoDB.listTables(listTableInput).continueWithBlock{ (task: AWSTask!) -> AnyObject! in
let listTablesOutput = task.result as AWSDynamoDBListTablesOutput
for tableName : AnyObject in listTablesOutput.tableNames {
println("\(tableName)")
}
return nil
}
I try to run my program, everything compiles, but stops at the line: let listTablesOutput = task.result as AWSDynamoDBListTablesOutput
When I say stops, I mean that I get a
Thread 6:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP,subcode=0x0)
Overall, I have spent hours reading documentation but it has not been able to answer any of my questions. Do we need to use DynamoDB to allow users to create an account and log in? If so, what exactly is Cognito for?
Also for the variables, shown in the code above, what exactly is credentialsProvider? Where do we get that information from?
Thank you in advance to anyone who can help me out in this matter.
Aucun commentaire:
Enregistrer un commentaire