An NSWorkspace object responds to application requests to perform a variety of services:
-
Opening, manipulating, and obtaining information about files and devices
-
Tracking changes to the file system, devices, and the user database
-
Getting and setting Finder information for files.
-
Launching applications
There is one shared NSWorkspace object per application. You use the class method sharedWorkspace to access it. For example, the following statement uses an NSWorkspace object to request that a file be opened in the TextEdit application:
[[NSWorkspace sharedWorkspace] openFile:@"/Myfiles/README" |
withApplication:@"TextEdit"]; |
NSWorkspace对象响应应用程序的各种服务请求,包括文件和设备的打开、操作与信息获取,跟踪文件系统、设备及用户数据库的变化,以及文件的Finder信息获取与应用启动。每个应用共享一个NSWorkspace对象,通过`sharedWorkspace`方法访问。
634

被折叠的 条评论
为什么被折叠?



