如何更改OCMock存根的返回值?

问题描述

| 似乎我第一次在OCMock存根上添加andReturnValue时,该返回值设置为固定值。例如:
id physics = [OCMockObject niceMockForClass:[DynamicPhysicsComponent class]
Entity *testEntity = [Entity entityWithPhysicsComponent:physics];
CGPoint velocity1 = CGPointMake(100,100);
CGPoint velocity2 = CGPointZero;
[[[physics stub] andReturnValue:OCMOCK_VALUE(velocity1)] getCurrentVelocity];
[testEntity update:0.1];
[[[physics stub] andReturnValue:OCMOCK_VALUE(velocity2)] getCurrentVelocity];
[testEntity update:0.1];
存根方法在[testEntity update]中调用。但是,每当有桩的方法每次都返回Velocity1值时,我想都没有兑现第二次设置方法返回值的尝试。 有没有办法在OCMock中做到这一点?     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)