开发者

Is there a counterpart to NSImageNameFolder for files?

开发者 https://www.devze.com 2023-04-04 02:24 出处:网络
NSImage comes with a number of system images. One of them being NSImageNameFolder for a generic folder icon.

NSImage comes with a number of system images. One of them being NSImageNameFolder for a generic folder icon.

What about a generic image for a single file or document? T开发者_运维知识库here does not seem to be such a thing as NSImageNameDocument...


You should be able to use the following:

NSImage *fileImage = [[NSWorkspace sharedWorkspace]
             iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon)];

If necessary, you may need to import <CoreServices/CoreServices.h>.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号