Googleでいくつかの調査を行ったところ、別のStackoverflow postで解決策が見つかりました。
ソリューション:
You need to add this code either in your xib/storyboard, either in your NSWindowController subclass -windowDidLoad method, either in your designated initialiser of your NSWindow subclass :
- (void) awakeFromNib {
[self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; //this was the one that worked for me
}
OR
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)styleMask
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)flag {
if (self = [super initWithContentRect:contentRect styleMask:styleMask backing:bufferingType defer:flag]) {
[self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
}
return self;
}
OR if you have a NSWindowController
- (void)windowDidLoad {
[super windowDidLoad];
[[self window] setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
}
OR Edit the nib file and add this behaviour to your window in XCode.
クレジット:Stefan Szekeres
私はちょうどあなたのソリューションをテストする時間を持っていたし、それが動作しませんが、NSPanelをテストします –