I am working on a document-based OSX application, with master-detail style windows. I understand how to open additional windows, to display additional information, by using -makeWindowControllers
and adding extra window controllers, but I can't set the title of the new windows. I have tried using -setTitle
and -windowTitleForDocumentDisplayName
in both Document.m
and in my sub-classed window controller class, but I can't get the window title to change.
How do I change the title of non-main-windows, which have a sub-classed window controller, in an NSDocument based application?
EDIT: I know there are some suggestions on SO about using an IBOutlet to the window to do this, but surely the window controller has a reference to its window anyway, right?
来源:https://stackoverflow.com/questions/27013061/how-can-i-set-the-title-of-non-main-windows-in-an-nsdocument-application