I\'m trying to add OCMock to my iOS 4 project. To test it out, I have a class Person
with one method, -hello
. When I run this test:
You don't have a bad configuration, it's a bug that Apple introduced in the simulator SDK when they released iOS4. Basically, if code invoked using an NSInvocation object throws an exception, then that exception is uncatchable. I wrote about the issue when it first appeared here:
http://pivotallabs.com/users/adam/blog/articles/1302-objective-c-exceptions-thrown-inside-methods-invoked-via-nsinvocation-are-uncatchable
Unfortunately, this bug affects OCMock and Apple hasn't show much interest in fixing it. Many people have filed bug reports, but to no avail.
I realize this is little comfort, but you will get slightly better error messages when using Cedar for testing (I believe the same is true for GTM).