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?
EDIT:
I use the new Apple LLVM 3.0 Compiler with ARC enabled and i think that might be the reason. But I’d like to fix it. Has anyone tried to compile OCMock with ARC?
Best wishes,
Daniel
As ‘removeFromSurperview’ is a UI method, maybe this could should be executed in main thread.
Regards,