1

So i'm using a storyboard AND a xib.

I use a tableview in my ViewController and it has a custom header as a xib file (the VC is the File Owner).

I want to present my new VC when swiping on the header, I added a swipe gesture to the xib using IB, but now i'm having problem presenting it.

Crash comes when i'm trying to instantiateViewControllerWithIdentifier. I made a property of my presented VC. And set the right Identifier "swipeRight".

    - (IBAction)swipedRight:(id)sender {
        NSLog(@"right");
        if (_mpvc == nil) { //user those if only so the use wont push it twice and more
            _mpvc = [self.storyboard instantiateViewControllerWithIdentifier:@"swipeRight"];
        }
[self presentViewController:_mpvc animated:YES completion:nil];
    }

The error:

Cannot find executable for CFBundle 0x9022120 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/AccessibilityBundles/GeoServices.axbundle> (not loaded)
Yevgeni
  • 1,533
  • 17
  • 32
  • http://stackoverflow.com/questions/18888059/cannot-find-executable-for-cfbundle-certuiframework-axbundle – Vizllx Apr 22 '14 at 12:25

1 Answers1

1

If you are inside a XIB file, how do you know which storyboard are you using? So first you have to instantiate storyboard which contains that viewController with specified identifier:

UIStoryboard *st = [UIStoryboard storyboardWithName:@"StoryboardName" bundle:nil];

After you have to instantiate viewController with this storyboard that you created:

UIViewController _mpvc = [st instantiateViewControllerWithIdentifier:@"swipeRight"];

Then finally you have to present the viewController:

[self presentViewController:_mpvc animated:YES completion:nil];

Hope it solves your problem!

E-Riddie
  • 14,660
  • 7
  • 52
  • 74