iosobjective-ccore-datarestkitrestkit-0.20

No visible @interface for RKDynamicMapping declares the selector setObjectMapping: whenValueOfKeyPath: isEqualTo - Restkit 0.2


Hi I'm trying to call setObjectMapping: whenValueOfKeyPath: isEqualTo on my dynamic mapping object. But it give me this error

No visible @interface for RKDynamicMapping declares the selector setObjectMapping: whenValueOfKeyPath: isEqualTo

RKDynamicMapping* dynamicMapping = [RKDynamicMapping new];
[dynamicMapping setObjectMapping:girlMapping whenValueOfKeyPath:@"type" isEqualTo:@"Girl"];

Where am I doing wrong ? Is it removed in RestKit 0.2 ?


Solution

  • Finally I found the solution . we can use addMatcher: matcherWithKeyPath: expectedValue: ObjectMapping property of the RKDynamicMapping object

    [dynamicMapping addMatcher:[RKObjectMappingMatcher matcherWithKeyPath:@"type" expectedValue:@"Girl" objectMapping:girlMapping]];