1
我有一個綁定NSTableView設置,我已經設置委託+數據源文件的所有者。表視圖的元素不會觸發委託方法。如果我點擊元素外部,即表視圖背景 - selectionShouldChangeInTableView
被調用。NSTableView綁定和tableViewSelectionDidChange
我不明白爲什麼tableViewSelectionDidChange
沒有被調用。嚴重的是爲什麼調試這麼困難?
-(void)tableViewSelectionDidChange:(NSNotification *)notification {
NSLog(@"%s", __PRETTY_FUNCTION__);
NSTableView *tableView = [notification object];
[[NSNotificationCenter defaultCenter] postNotificationName:TABLE_SELECTION object:tableView];
}
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)tableView {
NSLog(@"Hello there");
return YES;
}
刪除觀察者顯示你的方法的實現,或者至少,方法頭。 –
更新了問題。 – Rabiees
'selectionShouldChangeInTableView'總是返回YES嗎? – Willeke