Question

I am about to make a simple application to iOS in Xamarin studio for mac. My current problem is the fact that I want to be sent from one view to another. Currently, I have three views (They use the navigation controller with topbar):

Homescreen Accommodations Screen Index Screen These works that navigate between, "Home Screen" contains two buttons that lead to the two other views (Accommodations Screen, Screen Records). But if I create a third view, which is single. For example, the View "Dashboard Screen".

I want to be able to "link" "Dashboard Screen" from the "Facility Screen. How do I then do?, I tested the code below:

btn.TouchUpInside += (sender, e) => {
    DashboardScreen dashboardscreen = new DashboardScreen();
    NavigationController.PushViewController (dashboardscreen, false);
};

But then I get an error, Xamarin Studio opens the file "Main.cs" and mark the line:

UIApplication.Main (args, null, "AppDelegate");

I see that there is a "balloon" at that line that says:

NSInvalidArgymentException Reason: [LoginScreen btn] unrexognized selector sent to instance. 0x12628eb0

How could I correctly make the "btn" change view to "DashboardScreen" from "LoginScreen"?

Was it helpful?

Solution

Maybe the error is on your DashboardScreen page and not with navigating to it. What if you set it as the RootViewController and load into that page to make sure that it renders it correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top