EXC_BAD_ACCESS with partialMockForObject and a UIView

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

EXC_BAD_ACCESS with partialMockForObject and a UIView

Postby kie » 13 Nov 2011, 21:30

Hello,
I've got some troubles with OCMock and UIView.

I have sort of this code:

UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
id view1Mock = [OCMockObject partialMockForObject:view1];

[[[view1Mock expect] andForwardToRealObject] removeFromSuperview];

... something ...

[view1Mock verify];

And I do get really often a EXC_BAD_ACCESS on [[[view1Mock expect] andForwardToRealObject] removeFromSuperview]. But not every time. It's quite annoying because I'cant track it down to the line on OCMock and it's not occurring every time.

Any idea?

Best wishes,
Daniel
kie
 

Return to OCMock