Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

NullReferenceException after PushModalAsync

$
0
0

Hi!
My project, create under cross platforms, works very well under Android (I had to start development without iOS failing to have a mac)

Now i have a mac and i therefore implements the iOS party.
The MainPage starts, and works correctly (it is a login page, it manages to check the correspondence, to update the database if the entries are correct and to "memorize" check.

After the connection we transfer to a masterdetailpage (which contains a default tabbedpage which itself contains SfListView (list view with a swipe).

I run my application step by step, it seems to load the masterdetail, the tabbed and its 4 pages without worries.
However, after passing to "Navigation.PushModalAsync (new MasterPage ());"
IOS seems to return to its Main.cs and returns an exception on the line "UIApplication.Main (args, null," AppDelegate ");"
On the internet, I come across somebody having a similar problem, at the very moment that the error is made at launch (they recommend to affect the mainpage before FinishedLauching)

But my skills do not seem good enough to understand, or the bug (since they were talking about a xamarin bug) has been resolved since then. Always it is that my MainPage is launch correctly, but it crashes when browsing ...

If anyone could help me, I would be very grateful to him, because I can not find the solution ...

Here is my Main.cs:

public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
}

And here is the AppDelegate:
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());

        return base.FinishedLaunching(app, options);
    }
}

(Although I have already tried to modify it, I made sure to preserve the basic version, as nothing works, logically everything is by default)


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>