一
Bg:在TestTarget里面用Mantle進(jìn)行字典轉(zhuǎn)模型出現(xiàn)
Invalid parameter not satisfying: [modelClass isSubclassOfClass:MTLModel.class]
的錯誤
原因:如圖
68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3231363038392f313834353938372f36366163306435362d373562622d313165332d386561652d3131663332353636613734612e706e67.png
Mantle在test target存在main target里面的一份拷貝协屡,在運(yùn)行時鏈接的不是同一個所以報錯岗屏。
解決辦法
把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 刪掉
相關(guān)鏈接