通过以下步骤解决:
- 打开终端并输入以下命令:
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
- 重启Finder:
killall Finder
- 确认QTKit.framework已经链接到你的应用程序:
在Xcode中打开你的项目,导航到“Build Phases”选项卡,并确保“Link Binary With Libraries”包含QTKit.framework。
- 确认你的插件已经正确注册了UTI:
在你的插件信息.plist文件中添加以下代码块:
UTExportedTypeDeclarations
UTTypeConformsTo
public.image
UTTypeDescription
My Quick Look Plugin
UTTypeIdentifier
com.mycompany.myquicklookplugin
UTTypeTagSpecification
public.filename-extension
png
public.mime-type
image/png
根据你的需要修改代码块中的值。
- 如果你的插件需要调用其他框架,确保你的插件已经加载了这些框架:
在你的插件的Info.plist文件中添加以下代码块:
NSPrincipalClass
MyQuickLookHTMLPlugin
NSAllowsArbitraryLoads
NSAllowsLocalNetworking
NSScriptClass
MyQuickLookHTMLPlugin
CFBundleDependencies
NSURLConnection.framework
CFXML.framework
根据你的需要修改代码块中的值。
- 最后,重新编译你的插件并重新启