[Mono-osx] MonoMac retain/release
gnorton at novell.com
Tue Apr 20 13:37:57 EDT 2010
Whenever we bubble a proxy object, it takes a reference to the underlying native object, as such in the circumstance you described the object could not "go away"
On 2010-04-20, at 1:24 PM, Duane Wandless wrote:
> I noticed that retain/release/autorelease our internal methods. I'm not fan of doing memory management as that takes away time from solving business needs. Memory management is required with obj-c. And I believe these should be public.
> There are times when an object is passed as an argument into my C# code that must be retained while the C# code manipulates the object (typically a UI object)... then release that object when done. The most common usage is the UI is a delegate for the async C# method. At times the UI object will go away while the C# code is running its async task. The retain of course prevents sending a selector to a deallocated object. And there are times when the UI delegate selector is not invoked so I must be able to release the UI object from the C# code.
> I think one of the fundamental design patterns of MonoTouch and now MonoMac is that all the code will be written in C#. I do think this assumption is limiting. Giving the C# code full access to the obj-c objects allows for truly the best of both worlds. The advantages of the C# language can be leveraged.. but without limiting the functionality of the various NS classes within C#.
> Again my usage is a native obj-c app for the UI with the business logic in C#. There are advantages to fully developing within C# MonoMac .. I just want to push the design so that is not required.
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
More information about the Mono-osx