mac开发系列24:右键菜单打开文件夹并选中文件

mac实现右键菜单打开文件夹并选中文件,可使用如下系统api:
/* Activate the Finder and open a window selecting the file at the given path. If fullPath is nil, this will instead open the directory specified by rootFullPath, and not select any file. If rootFullPath is the empty string (@""), the file is selected in the main viewer. Otherwise, a new file viewer is opened. */-

(BOOL)selectFile:(nullable NSString *)fullPath inFileViewerRootedAtPath:(NSString *)rootFullPath;

效果图如下:



你可能感兴趣的:(mac开发系列24:右键菜单打开文件夹并选中文件)