3

我正在尝试编写一个小型 Cocoa 应用程序来帮助我管理我的时间,我希望它在启动时检查是否已经有一个启动条目,如果没有,则添加一个条目。

编写启动文件的正确文件夹是什么,和/或是否有特殊的可可方法来检索正确的文件夹是什么(即以与检索用户文档文件夹相同的方式)或者您只是假设以下其中一项困难编码位置?

手册页列出了我可能想要使用的以下可能的 URL ~/Library/LaunchAgents?

 ~/Library/LaunchAgents         Per-user agents provided by the user.
 /Library/LaunchAgents          Per-user agents provided by the administrator.
 /Library/LaunchDaemons         System-wide daemons provided by the administrator.
 /System/Library/LaunchAgents   Per-user agents provided by Mac OS X.
 /System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.
4

1 回答 1

3

如果您的应用程序将与用户交互,您可能需要 ~/Library/LaunchAgents。我不知道会为您返回此路径的 Cocoa 方法。

您可能应该查看有关代理和守护程序的详细技术说明:

http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html

于 2009-09-24T09:42:08.443 回答