2011-10-04 93 views

回答

4

這是一個簡單的單行與NSWorkspace。我們所需要做的就是打開ScreenSaverEngine。

這在夫特:

NSWorkspace.sharedWorkspace().openURL(NSURL(fileURLWithPath: "/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app")!) 

這在Objective-C:

[[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:@"/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app"]]; 
相關問題