I have a simple cocoa project, it has the default files like AppDelegate.m, AppDelegate.h , ViewController.h and ViewController.m what I want is to set the Window title to the dimension of the current window and update it as the user resizes it.
My Storyboard has an Application Scene, a Window Controller Scene and a test Scene which contains my view:
how do I go about this? should my ViewController or AppController implement NSWindowDelegate ?
Hello @aynas, if you'd like to change the default window title, you click the upper-right corner button on Xcode's main window to expand the Inspectors view. After selecting the window, you can use the Title text box to provide a new default name:
There are different ways to change the title of the window programmatically. One straightforward option is to access the window
property from your view controller's view
and change the title:
- (void)viewDidAppear {
[super viewDidAppear];
self.view.window.title = @"My title";
}