xamarin - On iOS device UIViewController returns System.Reflection.TargetInvocationException instead of actual View -


i'm upgrading existing game work ios 9.2. i'm using xamarin studio v5.10.1 (build 6) , xamarin ios v9.4.0.0 (i'm current on stable , beta channels).

i've got piece of code in uiviewcontroller contructor.

public mainviewcontroller() : base {     mainview = (mainview)this.view;     mainview.mvc = this;      initializedate();     initializegame();      gameloop(); } 

on simulator running ios 9.2 works correctly–this.view returns instance of mainview stored in instance variable mainview.

on device, iphone 5s running ios 9.2, this.view throws system.reflection.targetinvocationexception (the inner exception system.nullreferenceexception).

on versions of ios prior 7.0 code ran on device without throwing exception.

moving code above viewdidload or viewwillappear did not on device–the exception still thrown.

i can post stack trace if thinks helpful.

thanks in advance.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -