I’m creating a simple text editor for Mac using the Cocoa API and all works fine. The only problem is that the Close menu item is always disabled. Should I implement some delegate method in the document controller? Anyone who already had this problem?
Share
I finally figured it out. The problem is that every window of my document-based app is borderless, and I recently read that borderless windows cannot get closed via the
performClose:method that the menu item (or the Cmd-W key) sends to firstResponder. So I had to implement some additional methods in the window’s subclass:The last two methods make sure that the window can get the focus and that some other functions can be executed (like the Find command for textviews).