Delegates should be used for notifying that something has happened, and you should always include the source in your delegate callbacks. I.e `tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath`. That method provides both who sent it (the table view) and what happened (selected row at index path).

The way you use the delegate here it looks like you want to be able to control it, i.e close it and minimize it. This is not what delegates are for. In fact, this is creating tightly linked code. Now, the main controller has knowledge that there is a `window` of sorts that it can manipulate, which is bad.

You should change it so that the main controller is returning events, i.e
`mainController:(controller*)controller didPressClose:(nsbutton*)closebutton`

This allows the implementor to decide what to do with it, without tying the names to the actual action.