Can't Access the storyboard from SenTeskingKit

my question is that I am trying to test some stuff from SenTesking Kit.

-(void)testStoryboard {
    storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    STAssertNotNil(storyBoard, @"Can't access the storyboard");

I have also added the UIMainStoryboardFile to the DemoTests.plist but am getting this kind of error:

  • uipageviewcontroller class crashing on setting more than one view controllers
  • Passing parameters to a JSON web service in Objective C
  • AVMutableComposition of a Solid Color with No AVAsset
  • How to use NSURLCache to return cached API responses when offline (iOS App)
  • How to clear NSLog output from code?
  • Sharing classes between projects in xcode/objective-c
  • error: testStoryboard (DemoTests) failed: Could not find a storyboard named 'MainStoryboard' 
    in bundle 
    NSBundle</Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/usr/bin> (loaded)

    Solutions Collect From Internet About “Can't Access the storyboard from SenTeskingKit”

    I think you’re going to need to be more specific about the bundle here. When you pass nil for a bundle like this, it means “use the main bundle”, but if I recall correctly the main bundle when running tests will be the test harness applications bundle and not your code. I think you need to make sure that the storyboard is being included as a resource in the testing target and then you need to explicitly specify in the test that the storyboard resource is to be loaded from the your test target bundle and not the main bundle.

    EDIT: Typically a good way to do this might be to pass [NSBundle bundleForClass: [MyClassThatIKnowIsInTheRightBundle class]].