[Mono-list] Embedded API: Method signature not found with generic parameter

Robert Jordan robertj at gmx.net
Fri Jul 12 15:12:38 UTC 2013


Hi,

On 12.07.2013 15:06, jonathan at mugginsoft.com wrote:
>      // invoke the generic helper method
>      MonoObject *monoException = NULL;
>      void *hargs [2];
>      hargs [0] = methodInfo;
>      hargs [1] = mono_type_get_object(env.monoDomain, genericParameterType);
>      MonoMethod *genericMethod = (MonoMethod *)mono_runtime_invoke(helperMethod, NULL, hargs, &monoException);
>      NSAssert(genericMethod, @"invalid"); // passes

You have to unbox the result of mono_runtime_invoke because it
returns the IntPtr boxed in a MonoObject*.

Something like that:

MonoObject* obj = mono_runtime_invoke (...)
MonoMethod* genericMethod = *(MonoMethod**) mono_object_unbox (obj);


Robert



More information about the Mono-list mailing list