Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c QuickLook插件无法显示HTML_Objective C_Xcode_Xcode6_Quicklook - Fatal编程技术网

Objective c QuickLook插件无法显示HTML

Objective c QuickLook插件无法显示HTML,objective-c,xcode,xcode6,quicklook,Objective C,Xcode,Xcode6,Quicklook,我正在尝试在QuickLook插件中显示HTML GeneratePreviewForURL方法: **编辑** 预览窗口不会在调试模式下显示,但是,例如,从聚光灯选择联系人将显示预览 **/编辑** 最后,我得到下面列出的警告 我错过了什么?为什么预览与编译代码的工作方式不同 跟踪: Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const: conn 0x3

我正在尝试在QuickLook插件中显示HTML

GeneratePreviewForURL方法:

**编辑**

预览窗口不会在调试模式下显示,但是,例如,从聚光灯选择联系人将显示预览

**/编辑**

最后,我得到下面列出的警告

我错过了什么?为什么预览与编译代码的工作方式不同

跟踪:

Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const: conn 0x32807 token 0x1ffffffffffe85
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: Backtrace (at 118686):
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  0   CoreGraphics                        0x00007fff913f9215 CGSBacktraceCreate + 59
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  1   CoreGraphics                        0x00007fff91418688 _ZN16CGSUpdateManager14disable_updateEv + 84
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  2   AppKit                              0x00007fff8738ede5 -[NSWindow disableScreenUpdatesUntilFlush] + 127
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  3   AppKit                              0x00007fff878c394d -[NSVisualEffectView _createOrUpdateBackdrop:view:vibrancyEffect:] + 823
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  4   AppKit                              0x00007fff878c466a -[NSVisualEffectView _updateCGSWindowBackdrop] + 70
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  5   AppKit                              0x00007fff878c8294 -[NSVisualEffectView _update] + 147
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  6   AppKit                              0x00007fff878c7fc1 -[NSVisualEffectView layout] + 59
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  7   AppKit                              0x00007fff87370f54 -[NSView _layoutSubtreeWithOldSize:] + 373
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  8   AppKit                              0x00007fff873711a5 -[NSView _layoutSubtreeWithOldSize:] + 966
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  9   AppKit                              0x00007fff87364970 -[NSView layoutSubtreeIfNeeded] + 885
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  10  AppKit                              0x00007fff879e0e7a _NSViewLayoutSubtreesThatUseAutolayoutIfNeeded + 71
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  11  AppKit                              0x00007fff873c5b0f -[NSWindow(NSConstraintBasedLayout) _layoutViewTree] + 82
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  12  AppKit                              0x00007fff873f5569 -[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 244
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  13  AppKit                              0x00007fff8743162e _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 612
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  14  AppKit                              0x00007fff879f6cf1 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke1523 + 46
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  15  CoreFoundation                      0x00007fff923acd87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  16  CoreFoundation                      0x00007fff923acce0 __CFRunLoopDoObservers + 368
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  17  CoreFoundation                      0x00007fff9239ede8 __CFRunLoopRun + 872
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  18  CoreFoundation                      0x00007fff9239e838 CFRunLoopRunSpecific + 296
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  19  QuickLookUI                         0x00007fff84d2b50b -[QLPreviewView _startTimeOut] + 189
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  20  QuickLookUI                         0x00007fff84d0e1e1 -[QLPreviewPanelController _setCurrentPreviewItem:withTransition:blocking:] + 289
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  21  QuickLookUI                         0x00007fff84d0d916 -[QLPreviewPanelController _refreshLayoutAndContentBlocking:] + 250
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  22  QuickLookUI                         0x00007fff84d0efbc -[QLPreviewPanelController willOpen] + 734
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  23  QuickLookUI                         0x00007fff84d0612c -[QLPreviewPanel _openWithEffect:willOpen:toFullscreen:] + 945
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  24  qlmanage                            0x00000001000253b2 qlmanage + 152498
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  25  qlmanage                            0x0000000100004a8f qlmanage + 19087
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  26  libdyld.dylib                       0x00007fff8d7ad5c9 start + 1

我有同样的问题,调试或运行调试内置查找器都不起作用。然而,我观察到,如果我构建了用于运行的插件,那么它在Finder中就可以正常工作。

我对“KuttypeTHTML”内容类型UTI也有同样的问题。我无法使用Xcode进行调试,但部署的插件在Finder中正常工作。
我认为它开始出现在Mavericks上,后来在旧版本的OS X和Xcode上调试得很好。

KuttypeTHTML预览在Yosemite 10.10.3中得到了修复

<html><body><h1>First Last</h1></body></html>
...

NSDictionary *properties = @{
  (__bridge NSString *)kQLPreviewPropertyTextEncodingNameKey : @"UTF-8",
  (__bridge NSString *)kQLPreviewPropertyMIMETypeKey : @"text/html"
};

QLPreviewRequestSetDataRepresentation(
  preview,
  (__bridge CFDataRef)[html dataUsingEncoding:NSUTF8StringEncoding],
  kUTTypeHTML,
  (__bridge CFDictionaryRef)properties
);

...
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const: conn 0x32807 token 0x1ffffffffffe85
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: Backtrace (at 118686):
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  0   CoreGraphics                        0x00007fff913f9215 CGSBacktraceCreate + 59
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  1   CoreGraphics                        0x00007fff91418688 _ZN16CGSUpdateManager14disable_updateEv + 84
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  2   AppKit                              0x00007fff8738ede5 -[NSWindow disableScreenUpdatesUntilFlush] + 127
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  3   AppKit                              0x00007fff878c394d -[NSVisualEffectView _createOrUpdateBackdrop:view:vibrancyEffect:] + 823
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  4   AppKit                              0x00007fff878c466a -[NSVisualEffectView _updateCGSWindowBackdrop] + 70
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  5   AppKit                              0x00007fff878c8294 -[NSVisualEffectView _update] + 147
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  6   AppKit                              0x00007fff878c7fc1 -[NSVisualEffectView layout] + 59
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  7   AppKit                              0x00007fff87370f54 -[NSView _layoutSubtreeWithOldSize:] + 373
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  8   AppKit                              0x00007fff873711a5 -[NSView _layoutSubtreeWithOldSize:] + 966
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  9   AppKit                              0x00007fff87364970 -[NSView layoutSubtreeIfNeeded] + 885
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  10  AppKit                              0x00007fff879e0e7a _NSViewLayoutSubtreesThatUseAutolayoutIfNeeded + 71
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  11  AppKit                              0x00007fff873c5b0f -[NSWindow(NSConstraintBasedLayout) _layoutViewTree] + 82
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  12  AppKit                              0x00007fff873f5569 -[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 244
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  13  AppKit                              0x00007fff8743162e _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 612
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  14  AppKit                              0x00007fff879f6cf1 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke1523 + 46
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  15  CoreFoundation                      0x00007fff923acd87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  16  CoreFoundation                      0x00007fff923acce0 __CFRunLoopDoObservers + 368
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  17  CoreFoundation                      0x00007fff9239ede8 __CFRunLoopRun + 872
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  18  CoreFoundation                      0x00007fff9239e838 CFRunLoopRunSpecific + 296
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  19  QuickLookUI                         0x00007fff84d2b50b -[QLPreviewView _startTimeOut] + 189
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  20  QuickLookUI                         0x00007fff84d0e1e1 -[QLPreviewPanelController _setCurrentPreviewItem:withTransition:blocking:] + 289
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  21  QuickLookUI                         0x00007fff84d0d916 -[QLPreviewPanelController _refreshLayoutAndContentBlocking:] + 250
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  22  QuickLookUI                         0x00007fff84d0efbc -[QLPreviewPanelController willOpen] + 734
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  23  QuickLookUI                         0x00007fff84d0612c -[QLPreviewPanel _openWithEffect:willOpen:toFullscreen:] + 945
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  24  qlmanage                            0x00000001000253b2 qlmanage + 152498
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  25  qlmanage                            0x0000000100004a8f qlmanage + 19087
Nov 22 07:16:01 Pippin.local qlmanage[46393] <Warning>: void CGSUpdateManager::log() const:  26  libdyld.dylib                       0x00007fff8d7ad5c9 start + 1