解析 iOS 单元测试 PFUser 的子类

kcm*_*fat 5 unit-testing objective-c ios 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.
Run Code Online (Sandbox Code Playgroud)

我的 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.'
Run Code Online (Sandbox Code Playgroud)

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

我的 podfile 看起来像这样:

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

target 'WatchiTests' do

end
Run Code Online (Sandbox Code Playgroud)

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

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