
/* Get the icon for a given file type. The file type may be a filename extension,or a HFS code encoded via NSfileTypeForHFSTypeCode,or a Universal Type IDentifIEr (UTI). Returns a default icon if the operation fails. */- (NSImage *)iconForfileType:(Nsstring *)fileType;// Given an HFS file type code,return a string that represents the file type. The string will have been autoreleased. The format of the string is a private implementation detail,but such strings are suitable for inclusion in arrays that also contain file name extension strings. Several Cocoa API methods take such arrays.FOUNDATION_EXPORT Nsstring *NSfileTypeForHFSTypeCode(OSType hfsfileTypeCode);/* Type of the predefined/generic icons. For example,the call: err = GetIconRef(kOnSystemdisk,kSystemIconsCreator,kHelpIcon,&iconRef); will retun in iconRef the IconRef for the standard help icon.*//* Generic Finder icons */enum { kClipboardIcon = 'CliP',kClipPingUnkNownTypeIcon = 'clpu',kClipPingPictureTypeIcon = 'clpp',kClipPingTextTypeIcon = 'clpt',kClipPingSoundTypeIcon = 'clps',kDesktopIcon = 'desk',kFinderIcon = 'FNDR',kComputerIcon = 'root',kFontSuitcaseIcon = 'FFIL',kFullTrashIcon = 'ftrh',kGenericApplicationIcon = 'APPL',kGenericCDROMIcon = 'cddr',kGenericControlPanelicon = 'APPC',kGenericControlStripModuleIcon = 'sdev',kGenericComponentIcon = 'thng',kGenericDeskAccessoryIcon = 'APPD',kGenericdocumentIcon = 'docu',kGenericEditionfileIcon = 'edtf',kGenericExtensionIcon = 'INIT',kGenericfileServerIcon = 'srvr',kGenericFontIcon = 'ffil',kGenericFontScalerIcon = 'sclr',kGenericFloppyIcon = 'flpy',kGenericHarddiskIcon = 'hdsk',kGenericIdiskIcon = 'IDsk',kGenericRemovableMediaIcon = 'rmov',kGenericMoverObjectIcon = 'movr',kGenericPCCardIcon = 'pcmc',kGenericPreferencesIcon = 'pref',kGenericquerydocumentIcon = 'qery',kGenericRAMdiskIcon = 'ramd',kGenericSharedlibaryIcon = 'shlb',kGenericStationeryIcon = 'sdoc',kGenericSuitcaseIcon = 'suit',kGenericURlicon = 'gurl',kGenericWORMIcon = 'worm',kInternationalResourcesIcon = 'ifil',kKeyboardLayoutIcon = 'kfil',kSoundfileIcon = 'sfil',kSystemSuitcaseIcon = 'zsys',kTrashIcon = 'trsh',kTrueTypeFontIcon = 'tfil',kTrueTypeFlatFontIcon = 'sfnt',kTrueTypeMultiFlatFontIcon = 'ttcf',kUserIdiskIcon = 'udsk',kUnkNownFSObjectIcon = 'unfs',kInternationResourcesIcon = kInternationalResourcesIcon /* old name*/}; //获取应用程序的图标[[NSWorkspace shareDWorkspace] iconForfileType:NSfileTypeForHFSTypeCode(kGenericApplicationIcon)];总结
以上是内存溢出为你收集整理的通过HFS文件类型码获取图标全部内容,希望文章能够帮你解决通过HFS文件类型码获取图标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)