Ocmocito IOS-在Xcode 5.1上崩溃

Ocmocito IOS-在Xcode 5.1上崩溃,ios,crash,ocmockito,Ios,Crash,Ocmockito,当从模拟对象调用方法时,我在OCMockito上遇到了崩溃仅使用OCMockito-1.2.0 基本上,我所做的是: 包括OCHamcrestIOS.framework和OCMockitoIOS.framework。在frameworks文件夹中。 如果需要检查点,还要检查副本 然后我是我的测试代码我做了更简单的测试: - (void)testUsingNumbers { // assertThatInt(42, is(@42)); // assertThatUnsigned

当从模拟对象调用方法时,我在OCMockito上遇到了崩溃仅使用OCMockito-1.2.0

基本上,我所做的是: 包括OCHamcrestIOS.framework和OCMockitoIOS.framework。在frameworks文件夹中。 如果需要检查点,还要检查副本

然后我是我的测试代码我做了更简单的测试:

  - (void)testUsingNumbers
  {
   //  assertThatInt(42, is(@42));
  // assertThatUnsignedShort(6 * 9, isNot(@42U));

   NSArray *mockArray = mock([NSArray class]);

   // stubbing
   [given([mockArray objectAtIndex:0]) willReturn:@"first"];

   // following prints "(null)" because objectAtIndex:999 was not stubbed
   NSLog(@"%@", [mockArray objectAtIndex:999]);
} 
测试崩溃不是因为测试失败,而是因为调用模拟对象失败。 这是控制台消息:

[NSInvocation mkt_arrayArguments]: unrecognized selector sent to instance 0x2864db0
<unknown>:0: error: -[ExampleTests testUsingNumbers] : -[NSInvocation mkt_arrayArguments]: unrecognized selector sent to instance 0x2864db0
(
    0   CoreFoundation    0x00b1d5e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib   0x007958b6 objc_exception_throw + 44
    2   CoreFoundation    0x00bba903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation    0x00b0d90b ___forwarding___ + 1019
    4   CoreFoundation    0x00b0d4ee _CF_forwarding_prep_0 + 14
    5   ExampleTests      0x0279107a -[MKTInvocationMatcher setExpectedInvocation:] + 303
    6   ExampleTests      0x027901f9 -[MKTInvocationContainer setInvocationForPotentialStubbing:] + 150
    7   ExampleTests      0x0279251d -[MKTBaseMockObject prepareInvocationForStubbing:] + 52
    8   ExampleTests      0x027921b9 -[MKTBaseMockObject forwardInvocation:] + 79
    9   CoreFoundation    0x00b0d6da ___forwarding___ + 458
    10  CoreFoundation    0x00b0d4ee _CF_forwarding_prep_0 + 14

)
[NSInvocation mkt_arrayArguments]:发送到实例0x2864db0的无法识别的选择器
:0:错误:-[ExampleTests testUsingNumbers]:-[NSInvocation mkt_ArrayaGuments]:未识别的选择器已发送到实例0x2864db0
(
0 CoreFoundation 0x00b1d5e4例外预处理+180
1 libobjc.A.dylib 0x007958b6 objc_异常_抛出+44
2 CoreFoundation 0x00bba903-[NSObject(NSObject)不识别选择器:+275
3 CoreFoundation 0x00b0d90b\uuuuuuuuuuuu+1019
4 CoreFoundation 0x00b0d4ee\u CF\u转发\u准备\u 0+14
5示例测试0x0279107a-[mktinoviationmatcher setExpectedInviation:+303
6示例测试0x027901f9-[MKTInvocationContainer SetInvocationforPotentialStubing:+150
7示例测试0x0279251d-[MKTBaseMockObject PrepareInvocationForTubbing:+52
8个示例测试0x027921b9-[MKTBaseMockObject forwardInvocation:][79
9 CoreFoundation 0x00b0d6da uuuuuuuuuuuuuuu+458
10 CoreFoundation 0x00b0d4ee\u CF\u转发\u准备\u 0+14
)

我已经执行了3种不同的安装方式,但即使是源项目中的示例也会崩溃。该框架在xcode和mac OS的previos版本中运行良好。目前我使用的是xcode 5.1.1和Mac os 10.9.2

这个问题缺乏足够的信息来诊断问题。请包括并解释您试图实现的目标,以及您的结果与预期结果的差异。请阅读这篇和这篇博文。请特别注意“黄金法则”,尽管我强烈建议您阅读整篇文章。