我從來沒有與NSOutlineView工作過,我很好奇,如果單元格獲取釋放和項目崩潰時釋放?基於NSOutlineView的視圖中的單元格是否在崩潰時發佈?
我覺得每次展開和摺疊物品後,我的細胞都會堆疊在彼此的頂部。
任何形式的幫助,高度讚賞!
HSObjectViewModel* ovm = item;
HSObjectTableCellView *oCell = [outlineView makeViewWithIdentifier:@"OutlineCell"
owner:self];
oCell.textField.stringValue = ovm.hsObject.name;
NSImage* im = [[NSImage alloc] init];
if(ovm.isVisible) {
im = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:@"on" ofType:@"png"]];
} else {
im = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:@"off" ofType:@"png"]];
}
[oCell.eyeButton setImage:im];
oCell.eyeButton.target = self;
oCell.eyeButton.action = @selector(visibilityButtonClicked:);
[[oCell.eyeButton cell] setHighlightsBy:0];
對不起,只是編輯了這個問題......這是一個基於一個觀點 –