Reputation: 17777
I'm using ECSlidingViewController 0.9.0 (https://github.com/edgecase/ECSlidingViewController). I started with a fresh install with core data, arc & testing enabled, and installed ECSlidingViewController with Cocoapods.
When I run it in test mode, for some reason the slidingViewController method returns null instead of the InitialSlidingViewController.
This is the method defined in ECSlidingViewController.m
- (ECSlidingViewController *)slidingViewController
{
UIViewController *viewController = self.parentViewController;
while (!(viewController == nil || [viewController isKindOfClass:[ECSlidingViewController class]])) {
viewController = viewController.parentViewController;
}
return (ECSlidingViewController *)viewController;
}
In both simulator and test, self.parentViewController returns an InitialSlidingViewController.
But in test mode, [viewController isKindOfClass:[ECSlidingViewController class]] returns false instead of true.
Any idea where I should look next
Upvotes: 2
Views: 353
Reputation: 17777
Problem wasn't related to ECSlidingViewController.
The answer is here isKindOfClass: returns false negative in unit test bundle.
I removed the app's source files in the test bundle's compile sources build phase and it works now.
Upvotes: 2