解析iOS单元测试PFUser的子类

时间:2016-01-16 00:28:58

标签: ios objective-c unit-testing parse-platform pfobject

我正在尝试对PFObject子类的子类进行单元测试(使用XCTest),但我正在获取作为测试目标一部分的所有此类子类的警告:

Class MySubclassOfSubclassOfPFObject is implemented in both /var/mobile/Containers/Bundle/Application/84C7811F-348E-42EF-9FF4-F243DB669591/MyApp.app/MyApp and /var/mobile/Containers/Data/Application/A84479A8-1ACD-4F7B-B02D-A28CB412CD14/tmp/MyAppTests.xctest/MyAppTests. One of the two will be used. Which one is undefined.

我的PFUser子类也有例外:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to register both ParseUser and ParseUser as the native PFObject subclass of _User. Cannot determine the right class to use because neither inherits from the other.'

我已经通过cocoapods安装了Parse 1.12并运行了XCode 7.2。

我的podfile如下所示:

target 'Watchi' do
use_frameworks!
pod 'Parse'
end

target 'WatchiTests' do

end

在我的测试目标构建设置中,我将$(SRCROOT)添加到用户头搜索路径(递归),否则测试目标找不到PFObject + Subclassing.h。

知道为什么会发生这种情况?由于某种原因,单元测试/解析认为这些类有两个版本,但我的代码中只有一个文件。

0 个答案:

没有答案