【问题标题】:What folder should my application write its launchd file?我的应用程序应该在哪个文件夹中写入它的启动文件?
【发布时间】:2009-09-24 09:06:43
【问题描述】:

我正在尝试编写一个小型 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.

【问题讨论】:

    标签: objective-c cocoa launchd


    【解决方案1】:

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

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

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

    【讨论】:

    • “代理和守护进程”听起来像是丹布朗小说的标题。
    • @Alex - 他们有很大的模仿潜力。
    猜你喜欢
    • 1970-01-01
    • 2019-02-09
    • 1970-01-01
    • 1970-01-01
    • 2013-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多