一
Bg:在TestTarget里面用Mantle进行字典转模型出现
Invalid parameter not satisfying: [modelClass isSubclassOfClass:MTLModel.class]
的错误
原因:如图
68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3231363038392f313834353938372f36366163306435362d373562622d313165332d386561652d3131663332353636613734612e706e67.png
Mantle在test target存在main target里面的一份拷贝,在运行时链接的不是同一个所以报错。
解决办法
把Podfile里面的pod分类清楚
platform :ios, '7.0'
target 'Target'
pod 'pop'
pod 'Mantle'endtarget '
TargetTests' do
pod 'Expecta'end
如果你的test target 依赖了 main target 需要在other link flag里面把 -|Mantle 删掉
相关链接