设置NSViewController的背景色:
self.view.wantsLayer = YES;
self.view.layer.backgroundColor = [NSColor redColor].CGColor;
将App窗口移到最前并置为活跃状态:
[self.window makeKeyAndOrderFront:self];
[[NSRunningApplication currentApplication] activateWithOptions:NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps];

网友评论