我找到了解决方案,只需检索第二个屏幕的框架并在主屏幕中显示窗口,但使用第二个屏幕的框架
NSRect secScreenRect = [secondScreen frame];
myWindow = [[NSWindow alloc] initWithContentRect:secScreenRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO
screen:[NSScreen mainScreen]];
...