나는 조금 붙어있어서 애플 워드 프로세서에서 이것을 해결할 수 없다.NSTableView의 버튼 숨기기
NSTableCellView 내에 포함 된 NSTable 열에 두 개의 버튼이 있습니다.
코드에서 행의 개체 값에 따라 단추를 숨기려고합니다.
값을 가져 오는 것은 괜찮지 만 특정 단추를 대상으로 지정하는 방법을 알아낼 수 없으므로 표에있는대로 콘센트에 바인딩 할 수 없습니다. 아래 코드를 시도했지만 특정 단추 대신 전체 NSTableCellView를 숨기고 단추의 식별자를 변경하려고했지만 동일한 작업을 수행하는 것 같습니다.
if(selectedTweet.imageURL){
NSButton *imageButton = [tableView makeViewWithIdentifier:@"secondButtons" owner:self];
[imageButton setHidden:NO];
return imageButton;
} else {
NSButton *imageButton = [tableView makeViewWithIdentifier:@"secondButtons" owner:self];
[imageButton setHidden:YES];
return imageButton;
}
이것은 분명히 내가 제작하는 것보다 훨씬 간단합니다. ?? 도움말 크게 감사드립니다.
감사
가레스
귀하의 코드에서 볼 수있는 NSTableCellView 버튼을/숨김 조건에 따라 만들려는 것을 볼 수 있습니다. "secondButtonsWithButton"및 "secondButtonsWithoutButton"과 같이 IB에 두 개의 서로 다른 미리 정의 된 NSTableCellView를 갖고 각각을 호출하려고했습니다. 필요할 땐 ? – CoderPug