-
Notifications
You must be signed in to change notification settings - Fork 118
OCMockito FAQ
Jon Reid edited this page Sep 12, 2015
·
3 revisions
Use withMatcher:forArgument:
to specify matchers for specific arguments. Those matchers will take precedence over what is specified later. For example:
[[verify(mockObject) withMatcher:anything() forArgument:1]
someMethod:arg someRect:CGRectZero];
Here, the matcher for the CGRect has already been specified as anything()
. The value of CGRectZero
is ignored, but some rect is necessary to create the right method signature.
I'm getting "-[NSInvocation mkt_retainArgumentsWithWeakTarget]: unrecognized selector sent to instance"
Add -ObjC
to your Other Linker Flags.