[MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-17 Thread dotnet projects
Some times I get GC'ed ---> System.MissingMethodException: No constructor found for PenColor::.ctor(System.IntPtr when the app goes to the background and probably the memory warning is received. Is there anybody having similar problems? PenColor is UIViewController with Xib. This happens with any

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-19 Thread rnendel11
Because you're declaring at class scope vs. method scope. I'm guessing you have SGen enabled and possibly the experimental reference count option as well? I stopped using SGen myself, had GC issues and crashes. If you have those options enabled, try without them enabled. Also, I'm not entirely

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread René Ruppert
The code above (the first example with the local PenColor) should NOT crash. PresentModalViewController is supposed to hold a managed reference. If not, I'd consider that a bug. I'm using code like that all the time and do not get any crashes. I'm using SGen but have the experimental ref count syst

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Rodrigo Kumpera
Missing constructor crashes that show up only with sgen enabled doesn't mean it's an sgen bug per-se, but only that with the default GC it won't be triggered. Sgen is usually much more aggressive in releasing memory that the default GC. If you have a sample that reliably crashes with sgen (no exp

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Dotnet Projects
Thanks for the reply. I am not using SGEN but I am using following linker options --linkskip=mscorlib -aot "nimt-trampolines=512" It only happens in release mode (device). Unfortunately I cannot repeat it but I get logs from customer and I get same errors any where I use. myUIVIewControler p =

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Dotnet Projects
I am getting the error from MonoTouch..DialogViewController too. it might be related to the linker options I am using --linkskip=mscorlib -aot "nimt-trampolines=512" at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x0] in :0 at MonoTouch.ObjCRuntime.Runtim

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Nic Wise
I'm pretty sure this is a known problem - you have let the managed version (C# version) go out of scope, and it's been garbage collected. The Cocoa side wants to use the object, so the runtime trys to make the managed version again - but it can't as it doesn't have an IntPtr constructor. If you ca

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Dotnet Projects
I have to keep all Viewcontroller in the memory. Is there anything else I can do? Thanks Art On Mon, Aug 20, 2012 at 3:19 PM, Nic Wise wrote: > I'm pretty sure this is a known problem - you have let the managed > version (C# version) go out of scope, and it's been garbage collected. > The Cocoa

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Nic Wise
Make a constructor which takes an IntPtr as the single param. But it may cause other issues, I'm not sure On Mon, Aug 20, 2012 at 9:39 PM, Dotnet Projects wrote: > I have to keep all Viewcontroller in the memory. Is there anything else I > can do? > > Thanks > Art > > > On Mon, Aug 20, 2012 a

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-20 Thread Rodrigo Kumpera
This work-around will make your code work, but will cause your object to surface with no previous managed state, which is very very bad. The solution is trying to keep a reference to it from known live objects. On Mon, Aug 20, 2012 at 5:45 PM, Nic Wise wrote: > Make a constructor which takes an

Re: [MonoTouch] GC'ed ---> System.MissingMethodException

2012-08-21 Thread Nic Wise
Yeah, I guess a better reply from me woud be "But i may cause other issues which are worse than this one" :) On Mon, Aug 20, 2012 at 10:33 PM, Rodrigo Kumpera wrote: > This work-around will make your code work, but will cause your object to > surface with no previous managed state, which > is ve