task = [[task continueWithSuccessBlock:^id(BFTask *task)
{
NSLog(@"%@: Get profile for identity : %@", NSStringFromSelector(_cmd), cognitoUID);
AWSDynamoDBObjectMapper *dynamoDBObjectMapper = [AWSDynamoDBObjectMapper defaultDynamoDBObjectMapper];
return [dynamoDBObjectMapper load:[TPLCognitoUserDBO class] hashKey:cognitoUID rangeKey:nil];
}]continueWithBlock:^id(BFTask *task)
{
if (task.error) {
NSLog(@"%@: The request failed. Error: [%@]",NSStringFromSelector(_cmd), task.error);
}
if (task.exception) {
NSLog(@"%@: The request failed. Exception: [%@]", NSStringFromSelector(_cmd), task.exception);
}
if (task.result) {
TPLCognitoUserDBO *cognitoProfile = task.result;
if(cognitoProfile)
{
NSLog(@"%@: User ID %@ ::",NSStringFromSelector(_cmd), [cognitoProfile TPLHandle]);
[userIDFound setString: [cognitoProfile TPLHandle]];
} else {
NSLog(@"%@: Output has no records in it.", NSStringFromSelector(_cmd));
}
}
return nil;
}];
return task;
дает мне ошибкуAWSDynamoDB - пустой результат задачи
2015-08-24 22:41:21.539 myplan[9904:815677] -[AWSTask TPLHandle]: unrecognized selector sent to instance
2015-08-24 22:41:21.905 myplan[9904:815766] AWSiOSSDKv2 [Debug] AWSSignature.m line:320 | -[AWSSignatureV4Signer signRequestV4:] | payload {"Key":{"TPLCognitoID":{"S":"some value here"}},"TableName":"TPLCognitoUser"}
2015-08-24 22:41:22.341 myplan[9904:815766] AWSiOSSDKv2 [Verbose] AWSURLResponseSerialization.m line:79 | -[AWSJSONResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response body: [{}]
** DB Определение
@interface TPLCognitoUserDBO : AWSDynamoDBObjectModel <AWSDynamoDBModeling>
//Keys
@property (nonatomic, strong) NSString *TPLCognitoID;
//Other Attributes
@property (nonatomic, strong) NSString *TPLHandle;
Кажется, что 'task.result' является объектом' AWSTask', а не 'TPLCognitoUserDBO'. – Larme
@ Larme: dynamoDBObjectMapper load: [TPLCognitoUserDBO class] - Это должно гарантировать возврат объекта к типу TPLCognitoUserDBO? – himank
NSLog on task.result дает мне это Задача Результат –
himank