Mantle Error Parsing Credentials #1

Closed
sleroux opened this Issue Jul 15, 2014 · 2 comments

Projects

None yet

2 participants

@sleroux
sleroux commented Jul 15, 2014

I've setup a small sample project using Cognito but when I try to sync using some of the sample of code from the documentation I'm getting an error from Mantle that occurs within the [dataset synchronize] call when it tries to parse the Credentials object:

Caught exception +[NSValueTransformer mtl_JSONDictionaryTransformerWithModelClass:]: unrecognized selector sent to class 0x5d69e4 parsing JSON key path "Credentials" 

I've setup my credentials as per the documentation with my own keys:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    AWSCognitoCredentialsProvider *credentialsProvider = [AWSCognitoCredentialsProvider credentialsWithRegionType:AWSRegionUSEast1
                                                                                                        accountId:AWSAccountID
                                                                                                   identityPoolId:CognitoPoolID
                                                                                                    unauthRoleArn:CognitoRoleUnauth
                                                                                                      authRoleArn:CognitoRoleAuth];
    AWSServiceConfiguration *configuration = [AWSServiceConfiguration configurationWithRegion:AWSRegionUSEast1
                                                                          credentialsProvider:credentialsProvider];
    [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

    return YES;
}
@yosuke-matsuda

Are you using the frameworks instead of CocoaPods? If that is the case, you need to add -ObjC linker flag to your project settings. Please see Set Up the SDK for iOS for more details.

@yosuke-matsuda yosuke-matsuda self-assigned this Jul 15, 2014
@sleroux
sleroux commented Jul 16, 2014

Yup that was it! Forgot to port that change when I switched to a new project - Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment