Chengjiong
Chengjiong

Reputation: 1292

How to use RKValueTransformers.h along with RestKit

The RKValueTransformers's version is 1.1.0 and RestKit's is 0.20.3, both installed by cocoapods. After installation, I find in project there is 2 RKValueTransformers.h file, one is standalong RKValueTransformers, and the other is in RestKit. They cause conflict in building phase, does anyone know how to resolve this problem? The compile error is: /Code/Pods/RestKit/Code/CoreData/RKManagedObjectMappingOperationDataSource.m:85:5: Unknown type name 'RKDateToStringValueTransformer'; did you mean 'RKCompoundValueTransformer'?

Upvotes: 1

Views: 432

Answers (1)

Rahul Jiresal
Rahul Jiresal

Reputation: 1006

Upgrade the RestKit version to the latest one (0.23.3). Or the first one which has RKValueTransformers as a dependency (0.21.0). Then remove RKValueTransformers from the podfile. RestKit will add it automatically as a dependency.

Reasoning --

This is what was happening -- RestKit versions 0.20.3 (and earlier) have its own version of RKValueTransformers (.h and .m). So when you have RestKit 0.20.3 and also add RKValueTransformers, RestKit still refers to its own version, and not the pod you added. When you upgrade your version of RestKit, it starts referring to the pod dependency.

Upvotes: 1

Related Questions