Pixel Pedals of Tomakomai

北海道苫小牧市出身の初老の日常

【解決編】delegateもわからない

放置されてたdelegateの謎だが、なぜか勤務中に突然答えを閃いた。



まず、copy: senderについて。こいつはFirst Responderに送られてResponder chainを辿る。その際、NSWindowとNSApplicationのdelegateを巻き込む



The two windows and the NSApplication object also give their delegates a chance to handle action messages as though they were responders, even though a delegate isn’t formally in the responder chain.




で、前回オレが疑問に思った構成では、NSTableViewのデリゲートは同時にNSWindowのデリゲートにもなっていた。これはオレがついつい横着したため(笑)。



つまり、copy: senderに答えているのはNSWindowのデリゲートであって、NSTableViewのデリゲートではなかったと言うこと。



要は単なる勘違い