Skip to content

Instantly share code, notes, and snippets.

@Krumelur
Created April 27, 2015 09:24
Show Gist options
  • Save Krumelur/d4ffdf516f4f790058b7 to your computer and use it in GitHub Desktop.
Save Krumelur/d4ffdf516f4f790058b7 to your computer and use it in GitHub Desktop.
using CoreGraphics;
using Foundation;
using System;
using System.Runtime.CompilerServices;
using UIKit;
namespace MemoryTest
{
[Register("ViewController")]
public class ViewController : UIViewController
{
[CompilerGenerated]
private sealed class <ViewDidLoad>c__AnonStorey0
{
internal CustomButton btn;
internal void <>m__0(object sender, EventArgs e)
{
this.btn.RemoveFromSuperview();
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
}
}
public ViewController(IntPtr handle) : base(handle)
{
}
public override void ViewDidLoad()
{
ViewController.<ViewDidLoad>c__AnonStorey0 <ViewDidLoad>c__AnonStorey = new ViewController.<ViewDidLoad>c__AnonStorey0();
base.ViewDidLoad();
ViewController.<ViewDidLoad>c__AnonStorey0 arg_5E_0 = <ViewDidLoad>c__AnonStorey;
CustomButton customButton = new CustomButton();
customButton.set_Frame(new CGRect(0, 20, 320, 40));
customButton.someValue = 4711;
arg_5E_0.btn = customButton;
<ViewDidLoad>c__AnonStorey.btn.SetTitle("Click me", 0L);
<ViewDidLoad>c__AnonStorey.btn.add_TouchUpInside(new EventHandler(<ViewDidLoad>c__AnonStorey.<>m__0));
base.Add(<ViewDidLoad>c__AnonStorey.btn);
}
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
}
private void ReleaseDesignerOutlets()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment