开发者

Is there a counterpart to NSImageNameFolder for files?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜