I have created a document based Mac OSX application, and when I'm editing in Interface Builder, the title is correct (I filled out that portion of the inspector) but once the program runs, the application title is 'Untitled'. How can I change it? In my IB Doc Window, I have instances of Files Owner, First Responder, NSApplication, and NSWindow. There is no view controller, is that the issue? I'm new to Cocoa..
One solution is to override -displayName
in your NSDocument
subclass:
- (NSString *)displayName {
if (![self fileURL])
return @"Some custom untitled string";
return [super displayName];
}
You can also check out NSWindowController
's -windowTitleForDocumentDisplayName:
if you're using custom window controllers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With