static void ShowInstancesOf(TextWriter c, string type)
{
var weakList = MonoTouch.ObjCRuntime.Runtime.GetSurfacedObjects();
var res = from weak in weakList
let nso = weak.Target
where nso != null
let typeName = nso.GetType().FullName
where typeName == type
select nso;
c.WriteLine("<ul>");
foreach (NSObject nso in res)
{
c.WriteLine("<li>0x{0:x}</li>", nso.Handle);
}
c.WriteLine("</ul>");
}