Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to use WeakReference?

$
0
0

The Advanced Memory Management session at Evolve really opened my eyes. I have tried to use WeakReference<T> in my code:

public WeakReference <MyParentClass> parent;

but get an error "The non-generic type `System.WeakReference' cannot be used with the type arguments".

What am I doing wrong?

Have to add, this code does not generate the error:

public WeakReference parent;

but then I can't access any of the MyParentClass methods/properties.

Can anyone help me? Struggling to find any documentation on WeakReference.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>