Monotouch.Dialog 인스턴스를 배치하는 경우 :프로필 - 모노 - 다른 루트 역 참조
맞춤UIBubbleMapElement
요소는 GC에 의해 배치
- ;
- 각 배치 된 요소에 대해 사용자 정의
UIBubbleMapCell
도 GC에 의해 처리됩니다. - 그러나 모든 폐기 된 셀에 대해서는 사용자 정의
UIBubbleMapView
이 처리되지 않습니다.
이 문제를 해결하기 위해 Mono Profiler 응용 프로그램을 사용하기 시작했습니다.
질문 : 삭제 된되지 UIBubbleMapView
인스턴스 역 참조 화상 찾고. 이 마지막 참조를 어떻게 풀어 내 사용자 정의보기를 수집 할 수 있습니까?
마지막으로,이 내 UIBubbleMapCell
처분 방법입니다 :
protected override void Dispose (bool disposing) {
bubbleMapView = null;
System.Diagnostics.Debug.WriteLine ("############# {0} 'Dispose' {1}.", this, disposing ? "invoked directly" : "called by the garbage collector finalizer");
base.Dispose (disposing);
}
그리고 이것은 내가 콘솔에 인쇄있어 무엇 :
############# <UIBubblesViewController: 0x152427c0> 'Dispose' called by the garbage collector finalizer.
############# <UIBubbleMapCell: 0x152b6a40; baseClass = UITableViewCell; frame = (0 195; 320 38); autoresize = W; layer = <CALayer: 0x152c65c0>> 'Dispose' called by the garbage collector finalizer.
############# <UIBubbleMapCell: 0x1524aba0; baseClass = UITableViewCell; frame = (0 35; 320 38); autoresize = W; layer = <CALayer: 0x152038f0>> 'Dispose' called by the garbage collector finalizer.
############# <UIBubbleMapCell: 0x17c91710; baseClass = UITableViewCell; frame = (0 233; 320 116); autoresize = W; layer = <CALayer: 0x152cbb80>> 'Dispose' called by the garbage collector finalizer.
############# <UIBubbleMapCell: 0x1520b2c0; baseClass = UITableViewCell; frame = (0 108; 320 52); autoresize = W; layer = <CALayer: 0x17c2fc30>> 'Dispose' called by the garbage collector finalizer.
편집 : 감사합니다 롤프 당신의 대답.
첫째,이있는 UITableViewCell 폐기 방법에 다음 코드를 추가 :
bubbleMapView.Dispose();
bubbleMapView = null;
을 콘솔 내부에 다음 메시지를 수신하지만, 수집되지로서 여전히 객체를 제공하고 모노 프로파일 러. 이전과 같은 이미지.
############# <UIBubbleMapView: 0x154af370; frame = (0 0; 1 1); layer = <CALayer: 0x154af0e0>> 'Dispose' invoked directly.
intruments 앱에서 실행될 때 참조 횟수가 1보다 큰 것을 볼 수 있습니다.
이미지에서 UIBubbleTextView
인스턴스가 있지만 UIBubbleMapView
경우와 같은 방법으로 정확하게 동작합니다.
내 UIBubbleMapView
에는 다른보기가 있습니다. 이것은 역 참조가 확인되지 않을 때의 프로파일 러 정보입니다. 이러한 종류의 하위 뷰를 처리 할 트릭이 있습니까?