EXC_BAD_ACCESS when accessing parameters in andDo of OCMock

前端 未结 3 1054
终归单人心
终归单人心 2021-02-07 11:37

I am trying to write an block of code using OCMock\'s stub andDo method.

In this case UIImageView extension class is being tested. I want to check that the exte

3条回答
  •  孤街浪徒
    2021-02-07 11:59

    In my case this was happening because I introduced another parameter to this method, so the block parameter got shifted by one.

    I fixed it by changing [inv getArgument:&op atIndex:2] to [inv getArgument:&op atIndex:3]

提交回复
热议问题