macos – CFBundleTypeIconFile未显示给定文件扩展名的图标

macos – CFBundleTypeIconFile未显示给定文件扩展名的图标,第1张

概述我有我的应用程序的以下Info.plist,问题是我用扩展myapp保存的文件似乎没有拿起我从图标集创建的MyApp图标(应用程序正确使用图标)所以猜测有什么东西在plist中错了. 我假设如果我在某些时候运行我的应用程序时工作,我保存的文档会突然显示给定的图标. 如果这很重要,文档将从一组基于NSCoder的类中保存.单击这些文档也会打开我的应用程序并正确加载文件,因此很困惑我错过了以便在文件上 我有我的应用程序的以下Info.pList,问题是我用扩展myapp保存的文件似乎没有拿起我从图标集创建的MyApp图标(应用程序正确使用图标)所以猜测有什么东西在pList中错了.

我假设如果我在某些时候运行我的应用程序时工作,我保存的文档会突然显示给定的图标.

如果这很重要,文档将从一组基于NSCoder的类中保存.单击这些文档也会打开我的应用程序并正确加载文件,因此很困惑我错过了以便在文件上显示图标….

<?xml version="1.0" enCoding="UTF-8"?><!DOCTYPE pList PUBliC "-//Apple//DTD PList 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><pList version="1.0"><dict>    <key>CFBundleDevelopmentRegion</key>    <string>en</string>    <key>CFBundledocumentTypes</key>    <array>        <dict>            <key>CFBundleTypeExtensions</key>            <array>                <string>myapp</string>            </array>            <key>CFBundleTypeIconfile</key>            <string>MyApp</string>            <key>CFBundleTypeOSTypes</key>            <array>                <string>ASWM</string>            </array>            <key>CFBundleTypename</key>            <string>MyApp project file</string>            <key>CFBundleTypeRole</key>            <string>Editor</string>        </dict>    </array>    <key>CFBundleExecutable</key>    <string>${EXECUtable_name}</string>    <key>CFBundleIconfile</key>    <string>MyApp</string>    <key>CFBundleIDentifIEr</key>    <string>com.workmonkeys.${PRODUCT_name:rfc1034IDentifIEr}</string>    <key>CFBundleInfoDictionaryVersion</key>    <string>6.0</string>    <key>CFBundlename</key>    <string>${PRODUCT_name}</string>    <key>CFBundlePackageType</key>    <string>APPL</string>    <key>CFBundleShortVersionString</key>    <string>1.0</string>    <key>CFBundleSignature</key>    <string>ASWM</string>    <key>CFBundLeversion</key>    <string>1</string>    <key>LSApplicationcategoryType</key>    <string>public.app-category.developer-tools</string>    <key>LSMinimumSystemVersion</key>    <string>${MACOSX_DEPLOYMENT_TARGET}</string>    <key>NSHumanReadablecopyright</key>    <string>copyright © 2012 Me. All rights reserved.</string>    <key>NSMainNibfile</key>    <string>MainMenu</string>    <key>nsprincipalClass</key>    <string>NSApplication</string></dict></pList>
解决方法 当我最初创建我的应用程序时,系统必须已经缓存了pList的旧副本.所需要的只是重建启动服务数据库.

我使用了lsregister命令,如下所示……

http://www.tuaw.com/2009/06/11/terminal-tips-rebuild-your-launch-services-database-to-clean-up/

重新运行应用程序并将宾果文件现在分别关联相应的图标.

总结

以上是内存溢出为你收集整理的macos – CFBundleTypeIconFile未显示给定文件扩展名的图标全部内容,希望文章能够帮你解决macos – CFBundleTypeIconFile未显示给定文件扩展名的图标所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1034073.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存