用于 OS X Cocoa 的图像选择器或文件选择器

use*_*901 3 macos cocoa image

在我的应用程序中,我需要从文件系统中获取图像。我知道如何在 iOS 中做到这一点,但不知道如何在 OS X 中做到这一点。 OS X 有没有像 imagePicker 或文件选择器这样的工具?需要帮助请。

在 iOS 中我使用这个:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
Run Code Online (Sandbox Code Playgroud)

提前致谢!

Krz*_*tof 6

在 Mac 上有 IKPictureTaker,其工作方式与 UIImagePickerController 类似。

https://developer.apple.com/documentation/quartz/ikpicturetaker