[Mono-osx] Statics and Singletons with Dumbarton

R. Tyler Ballance tyler at bleepconsulting.com
Tue Jan 2 06:03:55 EST 2007


On Jan 2, 2007, at 4:27 AM, Andreas Färber wrote:

>
> Am 02.01.2007 um 09:55 schrieb R. Tyler Ballance:
>
>> Dumbarton would violate the access modifier for the constructor,  
>> and call it, and then when I would call the property method in my  
>> Cocoa code, it'd function as expected. This seems like a subtle  
>> bug, or is it something that is "allowed" within the constraints  
>> of the Mono embedded runtime?
>
> Through reflection from fully trusted code you can always call  
> private methods, whether embedding or from managed code.

Quirky :) Learn something new every day.

>> 	As far as I can tell there's not really a feasible way to call  
>> static methods through the Dumbarton bridge [...] almost all the  
>> calls require an instatiated MonoObject before invoking a method.
>
> Supply NULL as the MonoObject* instance, similarly to managed  
> reflection (null in C#).

How does this specifically translate to using singletons via  
Dumbarton? in the + (SingletonObject)sharedObject method instead of  
calling:
instance = [[self alloc] init];
calling something like
instance = [[[self alloc] initWithMonoObject:NULL];
and then using
instance = [self getProperty:"Instance"];


Looking over some of the embedding examples code, I've got a good  
idea of what you mean in terms of passing NULL, but I'm having  
trouble translating that to Dumbarton-Cocoa :P


Cheers

R. Tyler Ballance: Custom Mac and Linux Development at bleep. consulting
contact: tyler at bleepconsulting.com | jabber: tyler at jabber.geekisp.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20070102/9dbdcd91/attachment.html 


More information about the Mono-osx mailing list