私のUIKitDispose
オーバーライドのほとんどは、他のビューが破壊される前に、他のビューで何かを行います。
protected override void Dispose (bool disposing)
{
if (ScrollView != null) {
ScrollView.RemoveObserver (this, new NSString ("contentOffset"));
ScrollView.RemoveObserver (this, new NSString ("contentInset"));
ScrollView = null;
}
base.Dispose (disposing);
}
私は最近、それがDispose
ファイナライザースレッドで実行されることに気づきました。
この場合、不正な非UIスレッドから呼び出されます。disposing
false
ScrollView.RemoveObserver
UIKit関連のクリーンアップを安全に行う方法は何Dispose
ですか?