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>
.
精彩评论