Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Could not find a storyboard named ‘visit_info’ in bundle NSBundle

Published

I am getting this error whenever I try to access a ViewController from another storyboard programmatically. It seems that my xamarin.ios app is not recognizing the storyboard which is holding the ViewController. My storyboard name is visit_into.storyboard.

I have tried the following code

 UIStoryboard board = UIStoryboard.FromName("visit_info", null);
            UIViewController ctrl = (visitController)board.InstantiateViewController("visitController");
            ctrl.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
            this.PresentViewController(ctrl, true, null);

Here is the full error that I am getting on the first statement above:

Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Could not find a storyboard named 'visit_info' in bundle NSBundle </Users/amer/Library/Developer/CoreSimulator/Devices/3B343541-D0E1-410E-880C-18E9FE0289D8/data/Containers/Bundle/Application/A01C5D60-96A8-4BF8-993B-C0D90EE7EE5A/samra_op2.app> (loaded)
Native stack trace:
    0   CoreFoundation                      0x00007fff2043a126 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff20177f78 objc_exception_throw + 48
    2   UIKitCore                           0x00007fff247e48a6 -[UIStoryboard name] + 0
    3   samra_op2                           0x0000000100696699 xamarin_dyn_objc_msgSend + 217
    4   ???                                 0x00000001062ec539 0x0 + 4398695737 


 

Source: Xamarin.ios Questions

Published
Categorised as Uncategorised Tagged , , , ,

Answers

I know the answer but I need an explanation . When I made the controller the first time I edited the name and then changed all other names related to the controller including controller class name in controller.cs , controller.designer.cs and controller properties . When I tried the old name of the controller it somehow worked.


Alaina Nitzsche

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq