1

I'm trying to segue from a view controller to an AVKit Player View Controller. I'm using Vuforia's framework to do image recognition on a camera. My issue is that when I try to segue over, it says that segue just doesn't exist. However, if I segue to a different controller and then segue into the video player it works fine. Took me a long time to even find that work around. If you have any ideas on why this is, let me know please. I understand this probably isn't an easy problem to replicate without using Vuforia's SDK, so any additional details that you need let me know.

Segue code:

    [self performSegueWithIdentifier:@"test" sender:self];

I promise the name of the segue is correct, because it worked into the regular View Controller. I also tried programmatically playing using AVPlayerViewController, but that was a nightmare in terms of handling Vuforia's protocols.

Built In Parris
  • 179
  • 1
  • 3
  • 19
  • Is the segue performed on a view controller that is actually created from a storyboard, and is actually the source of the named segue? – jcaron Dec 14 '15 at 23:46
  • Yeah. [The view controller exists in the storyboard.](https://drive.google.com/file/d/0B_R13WHYqzPUQkdBYUlVMXR0WjA/view?usp=sharing) – Built In Parris Dec 14 '15 at 23:52
  • Just a note to future people, if you use the method inside a viewDidLoad or any method that is called before the view has appeared, it will error. However, the above error is happening long after the view has appeared. – Built In Parris Dec 14 '15 at 23:57
  • How/when is that segue triggered? Can't see any button or other UI. If you perform the segue right away (e.g. in `viewDidLoad`), the view controller is probably not on screen yet. – jcaron Dec 14 '15 at 23:57
  • What error message are you getting? – jcaron Dec 14 '15 at 23:59
  • It was triggered when an image is recognized. Sorry, the above picture is an example of the working version being passed through another view controller, and then when it hits ViewDidAppear it segues to the AVKit and plays the video. I am unable to call that within any function inside of my other view controller though. – Built In Parris Dec 15 '15 at 00:00
  • So you're confirming that the view controller exists in the storyboard by showing us another storyboard? Please show us (the part of) the actual storyboard where you encounter the issue. – jcaron Dec 15 '15 at 00:01
  • AH. I see the problem. I'm calling the method that triggers the video from a different class, so it is trying to use that class rather than the view controller I'm currently on when I tell it self. It does work if I trigger it directly from the double tap gesture. I'll look up how to get the currently visible view controller. Thanks so much @jcaron. – Built In Parris Dec 15 '15 at 00:11

1 Answers1

1

My issue was related to the fact that I was trying to call the segue command from a class rather than the actual view controller, and since the class wasn't attached to anything by segue, it didn't know what to do with the command to segue.

Built In Parris
  • 179
  • 1
  • 3
  • 19