0

So I have a programmatically created array of "buttons" which are actually UIImageViews. All of the buttons can create an action, or give an Alert. When this button is pushed I want it to go to a scene in my storyboard. Here is the code that I've tried out that I thought would have worked:

    if (b3.alpha>0.75 && CGRectContainsPoint(b3.frame, location))
    {
        [self performSegueWithIdentifier:@"News" sender:self];
    }

I have a segue from the menu view controller to my news view controller with my Segue Identifier as News. My problem is that if I were push to the NewsViewController's class the news display doesn't register for some reason. It seemed that if i set the news scene to the initial view controller it works perfectly, and I've put a button on the scene temporarily and pushed from button to scene and that worked perfectly as well.

I've looked around for another solution but no matter what I try it either will not go to the scene in the storyboard or i'll keep getting libc++abi.dylib: terminating with uncaught exception of type NSException.

Any help would be appreciated!

  • Is your Main View Controller wrapped in a Navigation Controller? – jhilgert00 Nov 24 '13 at 17:15
  • You should post the actual error message. – rdelmar Nov 24 '13 at 17:31
  • My Main View Controller is wrapped in a navigation controller – user3027713 Nov 24 '13 at 21:28
  • I think I may have also put the wrong error message: – user3027713 Nov 24 '13 at 21:30
  • 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'NewsViewController' and directory 'MainStoryboard.storyboardc'' – user3027713 Nov 24 '13 at 21:33
  • i found this http://stackoverflow.com/questions/5415252/nsinternalinconsistencyexception-could-not-load-nib-in-bundle – LanternMike Nov 24 '13 at 22:45
  • The weird thing is, if I comment out the code and then set the News Controller as the initial view controller it works perfectly. But if I try to push to the scene programmatically through the Main view controller with a segue it give me that error. – user3027713 Nov 25 '13 at 00:22
  • Why are you using UIViews instead of buttons? It's probably better to use a custom UIButton instead. http://stackoverflow.com/questions/7984500/how-to-make-custom-buttons-in-ios – ahruss Feb 17 '14 at 19:57

0 Answers0