You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are doing [fileMenuItem setSubmenu:fileMenu];, right? But even with that, you're right it doesn't work. Though I'm also very new to GNUstep/Cocoa, so I have no idea what is actually supposed to happen.
This property contains a string value indicating the title of the menu. If the menu is a submenu of the application’s main menu, then the title of the menu appears in the menu bar.
In any case, this doesn't seem to be related to initWithTitle, but rather that in the top code you're setting the title of the NSMenuItem, in the bottom code you're setting the title of the NSMenu.
This works:
NSMenuItem *fileMenuItem = [NSMenuItem new];
NSMenu *fileMenu = [[NSMenu alloc] initWithTitle:@""];
[fileMenuItem setTitle:@"File"];
But this does not work:
NSMenuItem *fileMenuItem = [NSMenuItem new];
NSMenu *fileMenu = [[NSMenu alloc] initWithTitle:@"File"];
The text was updated successfully, but these errors were encountered: