我观看了Getting Started with Instruments ,其中显示了Signposts的用法。该示例是用Swift编写的,但我想在我的Objective-C项目中使用它们。
在这些示例中,路标开始和结束是在函数内部设置的,这意味着它们将被相应地触发。我的项目是一个插件,其结构不同,我只有一个被调用一次的“主”函数,然后我使用自定义类中的一系列方法来加载和解析不同类型的数据。因为它都是连续的......我可以只有一个os_log_tand并用+os_signpost_id_t一遍又一遍地重新利用它吗?或者这不安全,因为该方法可能会在触发后返回?或者如果他们这么快就接到多次电话,他们会不会发生冲突?os_signpost_interval_beginos_signpost_interval_endend
谢谢。
// Initialize
os_log_t log = os_log_create("com.example.plugin", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
os_signpost_id_t spid = os_signpost_id_generate(log);
// Measurement 1
os_signpost_interval_begin(log, spid, "testMethodA started");
[MyClass testMethodA:arg1 withOptions:arg2];
os_signpost_interval_end(log, spid, "testMethodA finished");
// Measurement 2
os_signpost_interval_begin(log, spid, "testMethodB started");
[MyClass testMethodB:arg1 withOptions:arg2];
os_signpost_interval_end(log, spid, "testMethodB finished");
[...]
Run Code Online (Sandbox Code Playgroud) 根据 Apple 的说法,我们应该新建缩略图或预览扩展,而不是旧的快速查看生成器,后者将被弃用(可能在Big Sur中)。
也不再有Quick Look plug-in project在Xcode中创建的选项。相反,您需要创建一个包含 Quicklook 扩展的应用程序target。
我的问题是:如果没有无用的包装应用程序,我是否可以不再创建独立的Quick Look 扩展(或插件)来预览文件?有没有人尝试过或发现这是否仍然是一个选择?
谢谢。
我正在尝试在Xcode中调试适用于macOS的 Quick Look Extension 目标(预览版) ,尽管我指定了不同的可执行文件 ( ),但每次我在Xcode中运行Quick Look Simulator时,它都会不断启动 Quick Look Simulator ,这很烦人。qlmanage
如何阻止快速查看模拟器与我的预览一起启动qlmanage?我在我的计划中没有看到禁用此功能的方法。
谢谢。
我正在编写一个Quicklook插件来预览App捆绑包.当我尝试在Xcode 6.1(Yosemite)下调试它时,我无法让它工作.'Quicklookd'启动并在Dock中保持打开状态,但它不会呈现任何预览,我在控制台中获得此输出:
Testing Quick Look preview with files:
/Applications/Font Book.app
[DEBUG] Preview test for file:///Applications/Font%20Book.app/. Content type UTI: com.apple.application-bundle
[DEBUG] Previewing file:///Applications/Font%20Book.app. Content type UTI: com.apple.application-bundle. Generator used: <QLGenerator /Users/imac/Library/QuickLook/TestPlugin.qlgenerator>
[DEBUG] Loading <QLGenerator /Users/imac/Library/QuickLook/TestPlugin.qlgenerator>
[DEBUG] Previewing file:///Applications/Font%20Book.app finished
2015-02-04 10:59:35.188 qlmanage[1664:138646] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x9103, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2015-02-04 10:59:35.188 qlmanage[1664:138646] Failed to allocate communication port for com.apple.CFPasteboardClient; this is likely due to sandbox restrictions
Feb 4 …Run Code Online (Sandbox Code Playgroud) 您好,我需要编写一个lldb断点命令来计算一个值并打印出一个值。在gdb中我可以这样做:
if ($value==2)
printf "Value is 2\n"
end
Run Code Online (Sandbox Code Playgroud)
但在 lldb 中,“if 语句”似乎无效:
failed with error: 'if' is not a valid command.
error: Unrecognized command 'if'.
Run Code Online (Sandbox Code Playgroud)
谁能告诉我如何在断点命令中编写此比较?谢谢!
xcode ×4
macos ×3
quicklook ×3
breakpoints ×1
command ×1
command-line ×1
debugging ×1
if-statement ×1
keychain ×1
lldb ×1
logging ×1
methods ×1
objective-c ×1
osx-yosemite ×1
preview ×1
security ×1
signpost ×1
simulator ×1