如何在C ++中禁用OS X应用程序? [英] How to disable OS X App Nap in C++?
问题描述
有一种方法可以从C ++应用程序的源代码中禁用App Nap。
Is there a way to disable App Nap from the source code of a C++ application?
我使用clake编译器与cmake。
I'm using the clang compiler with cmake.
推荐答案
OS X 10.9的Foundation发行说明提供了有关如何和何时激活App Nap的一些详细信息, a href =https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSProcessInfo_Class/Reference/Reference.html =nofollow> NSProcessInfo
类可以用来禁用它(具体来说,使用 beginActivityWithOptions:reason:
)。
The Foundation Release Notes for OS X 10.9 gives some details on how and when App Nap is activated, and notes that the NSProcessInfo
class can be used to disable it (specifically, using beginActivityWithOptions:reason:
).
App Nap似乎没有任何C或C ++接口。
There doesn't appear to be any C or C++ interface to App Nap.
这篇关于如何在C ++中禁用OS X应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!