I'm trying to mock a UITabBarController in my app's tests. I have a category method on that class defined elsewhere in another file that gets imported along with ocmock in my test class. what i'm trying to so is this:
- (void) setUp
{
id mockTabController = [OCMockObject mockForClass:[UITabBarController class]];
[[[mockTabController stub] andReturn:nil] displayedViewController];
// displayedViewController is the category method
}
but when i do and the test gets to that stub call, i get an error saying:
[NSProxy doesNotRecognizeSelector:displayedViewController] called!
Is there something specific i need to do to allow ocmock to recognize category methods on built in framework classes?