我有一个播放声音的按钮,它似乎在模拟器上工作得很好,但我收到这条消息:
Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-01 02:13:02.605 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-01 02:13:02.657 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-01 02:13:02.671 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in …
我正在为 iOS 构建一个操作扩展,它可以简单地操作文本。目前,传递转换后的文本的唯一有效方法是将其复制到 UIPasteboard,但我已经看到了一些示例,并通读了很少的文档,以找到“解决方案”。
我已经尽可能多地遵循了示例,这是我发现的唯一方法:
func extensionItem(with text: String) -> NSExtensionItem {
let itemProvider = NSItemProvider(item: text as NSSecureCoding?, typeIdentifier: kUTTypeText as String)
let item = NSExtensionItem()
item.attachments = [itemProvider]
return item
}
Run Code Online (Sandbox Code Playgroud)
虽然似乎没有应用程序支持阅读它。
我在野外看到的工作版本是在工作流程中。如果您创建的工作流程只是一个操作 - 将大小写更改为大写,则可以使用文本选择中的共享表,它将返回 NSExtensionItem,并且源应用程序将用新内容替换文本。
我不确定这是否是一般应用程序行为,或者只有一些应用程序支持这一点。但由于某种原因,我似乎做错了什么。
我发现的唯一提示是,在从工作流返回的 NSExtensionItem 中,内容实际上是 .txt(位于某处)的 URL,其中包含新内容。
有谁知道我哪里出错了?
苹果似乎缺乏这方面的文档。
在fish中,您可以测试是否存在特定文件test -e hello.txt,但我想知道是否有办法在文件名中使用通配符值,以检查是否存在任何文件类型.
更具体地说,我正在制作一个检查Xcode工作空间的快速功能,如果发现它打开它,如果没有,则检查Xcode项目,如果发现它打开,否则打印错误.
这是当前的实现:
function xcp
open *.xcodeproj
end
function xcw
open *.xcworkspace
end
function xc
if test -e *.xcworkspace
xcw
else if test -e *.xcodeproj
xcp
else
echo "No Xcode Workspace or Project in this directory."
end
end
Run Code Online (Sandbox Code Playgroud)
它在一分钟"工作",但是当它找不到工作空间或项目文件时,它会输出一个关于没有匹配的错误.然而,这是默认情况下完成的,我想知道我是否可以以某种方式隐藏它.
这是错误输出,当它找不到工作区时,但找到一个项目并打开:
No matches for wildcard '*.xcworkspace'. (Tip: empty matches are allowed in 'set', 'count', 'for'.)
~/.config/fish/functions/fish_prompt.fish (line 1): if test -e *.xcworkspace
^
in function 'xc'
called on standard input
Run Code Online (Sandbox Code Playgroud) 我现在开始将我的一个应用程序移植到Android并停留在一个非常基本的位,基本上在我的应用程序中我设置NSArray然后调用:
int chosen = arc4random() % [array count];
textOutput.text = [array objectAtIndex: chosen];
Run Code Online (Sandbox Code Playgroud)
但我似乎无法在Android中得到这个.
我只需要手动设置数组,然后从中随机选择一个字符串.
-----我如何管理它-----
ArrayList<String> array = new ArrayList<String>();
array((new String("Blah, blah.")));
String randString = new String();
randString = array(new Random().nextInt(array()));
textBox.setText(randString, TextView.BufferType.EDITABLE);
Run Code Online (Sandbox Code Playgroud) 我有一个位于菜单栏中的应用程序,当您单击该按钮时,它会显示NSPopover.
一切正常,但我希望NSSearchField成为第一个响应者,因此用户可以直接在框中输入.
但是,如果尚未选择该应用,则无法使用.虽然看起来搜索框处于活动状态,但键盘输入会转到之前打开的应用程序,因为从技术上讲它仍然是活动窗口.
我已经看到了一些关于这样的事情的问题,但它们都需要像makekeyandorder这样的objc方法,或者只是不适用于NSPopover的东西.
所以我的问题是 - 是否有一种方法,当按下按钮时,我可以强制应用程序成为活动的应用程序?
我有一个疯狂的猜测并试过NSApplication().sharedApplication().becomeFirstResponder(),但没有运气.
如果有另一种方法,我完全错过了,那么请让我知道!