So I have an instance of MyViewController in the detail view of a UISplitViewController. I am running a unit test to see whether the detail view contains the correct type of
Had the same issue with one of my apps, fixed it by removing .m file from Test target. In your case removing MyViewController.m from the test target will fix your issue. Open your .m file .Go to right navigator in Xcode and remove the tick from Target membership for test target. Problem is compiler compiles two MyViewController.m (one for app one for test) and .class may return different object.