xcode SetAppThreadPriority:setpriority 失败,错误 45
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24030522/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SetAppThreadPriority: setpriority failed with error 45
提问by user3699052
Hello I have an issue with my app:
您好,我的应用程序有问题:
SetAppThreadPriority: setpriority failed with error 45
I am using Xcode 6 and I am not sure if this is the issue.
我正在使用 Xcode 6,但我不确定这是否是问题所在。
回答by Mike
I am new to Xcode so perhaps this is expected behavior, but i found that i get this error if i have the GameScene.Swift file selected in the project navigator when i run the simulation. But if i have the top level folder selected it runs fine without this error. By selected, i just mean clicked on so it's highlighted..
我是 Xcode 的新手,所以这可能是预期的行为,但我发现如果我在运行模拟时在项目导航器中选择了 GameScene.Swift 文件,我会收到此错误。但是如果我选择了顶级文件夹,它运行良好,没有这个错误。通过选择,我的意思是点击所以它突出显示..
Other suggestions did not solve it for me.
其他建议没有为我解决。
回答by teovox
if you are using storyboard, go to Targets -> General and check the Main Interface property if your storyboard is selected.
如果您使用的是故事板,请转到目标 -> 常规并检查主界面属性(如果您的故事板已被选中)。
回答by Oxcug
I'm confident this is a bug within the Xcode beta. I'd love to share why, but it's against Apple's TOS. There's nothing wrong with your code. You should submit a bug report to Apple: bugreport.apple.com
我相信这是 Xcode 测试版中的一个错误。我很想分享原因,但这违反了 Apple 的 TOS。你的代码没有任何问题。您应该向 Apple 提交错误报告:bugreport.apple.com
回答by user3708023
You are not setting the thread priority for your NSOperation. Here is an example in Swift that gives the error you are seeing and one that doesn't. I'm assuming the same error message will appear if you are using Objective-C
您没有为 NSOperation 设置线程优先级。这是 Swift 中的一个示例,它给出了您看到的错误和没有的错误。我假设如果您使用的是 Objective-C,则会出现相同的错误消息
Does
做
let backgroundOperation = BackGroundSillyness()
queue.addOperation(backgroundOperation)
backgroundOperation.completionBlock = {
println("hello from completion")
}
println("hello from UI thread")
Doesn't
没有
let backgroundOperation = BackGroundSillyness()
queue.addOperation(backgroundOperation)
backgroundOperation.threadPriority = 0
backgroundOperation.completionBlock = {
println("hello from completion")
}
println("hello from UI thread")