Xamarin.ios datetime crash on device

I made a very simple Xamarin.iOS application, but my application immediately worked when I launched it on the device: iPhone 4 and iPhone 5. It works correctly in the simulator and on the iPhone 5s device.

Whenever I use a DateTime object, my application crashes.

I use the following versions of Xamarin.iOS:

Xamarin Studio Version 4.2.3 (Build 59) Runtime: Mono 3.2.6 ((no / 9b58377) Package Version: 302060000

Xamarin.iOS Version: 7.0.7.2 (Business Edition) Build date: 2014-17-02 17: 43: 23-0500

Relevant code (I started with the utility template from xamarin):

    public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();


        var testDateTime = DateTime.Now;

        Console.WriteLine (testDateTime.ToString ());
    }

In Xcode, I get this error: Type of exception: EXC_BAD_ACCESS (SIGSEGV)

Does anyone know what a mistake is?

+4
1

DateTime Xamarin, . ​​Xamarin .

:

CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("de-DE");

.

+3

Source: https://habr.com/ru/post/1529633/


All Articles