1
我試圖讓應用程序啓動在演示模式,同時禁止在Dock中,菜單欄,進程切換等我到目前爲止這樣的代碼:如何爲Mac應用程序設置Kiosk模式?
let presOptions: NSApplicationPresentationOptions =
.HideDock | // Dock is entirely unavailable. Spotlight menu is disabled.
// .AutoHideMenuBar | // Menu Bar appears when moused to.
// .DisableAppleMenu | // All Apple menu items are disabled.
.DisableProcessSwitching | // Cmd+Tab UI is disabled. All Exposé functionality is also disabled.
.DisableForceQuit | // Cmd+Opt+Esc panel is disabled.
.DisableSessionTermination | // PowerKey panel and Restart/Shut Down/Log Out are disabled.
.DisableHideApplication | // Application "Hide" menu item is disabled.
// .AutoHideToolbar |
.FullScreen
let optionsDictionary = [NSFullScreenModeApplicationPresentationOptions: presOptions]
browserWindowController.containerView.enterFullScreenMode(NSScreen.mainScreen()!, withOptions: optionsDictionary)
在.HideDock線我得到的錯誤:
Type of expression is ambiguous without more context
有人能幫我找到解決辦法,並解釋錯誤的含義。
同樣在browserWindowController線我得到的錯誤:這是爲什麼不工作,我
Use of unresolved identifier 'browserWindowController'
有人能解釋一下嗎?
哇,這很快。謝謝你的工作,但我仍然有一個browerWindowController行錯誤。你知道它是什麼,甚至我應該用什麼來代替線條?謝謝 – grahamcracker1234
不客氣。找到你正在創建的位置'let browserWindowController = ...'它似乎超出了你想要使用變量的地方。 – Moritz
好的,謝謝,我沒有在任何地方聲明。我是新開發的Mac應用程序,並且只有IOS經驗,所以在完全設置演示文稿選項時我完全失去了它。你能解釋一下我應該用什麼來代替browserWindowController這一行。 – grahamcracker1234