【问题标题】:How to make a startup entry in cocoa如何在可可中创建启动条目
【发布时间】:2012-07-11 06:13:44
【问题描述】:

我想将我的程序的启动条目放在系统中,以便每次启动系统时它都会运行。但是如何在可可中做,我不知道,请为此提供帮助。我是可可的新手。

提前致谢

【问题讨论】:

    标签: objective-c macos cocoa startup


    【解决方案1】:

    您可能想使用来自 github 的类似这个库的东西:https://github.com/Mozketo/LaunchAtLoginController

    LaunchAtLoginController *launchController = [[LaunchAtLoginController alloc] init];
    [launchController setLaunchAtLogin:YES];
    [launchController release];
    

    【讨论】:

    • 我已经创建了这两个类,但在编译期间。我在 LauchATLoginController.m 错误中收到错误(Loginitem 未声明首次在函数中使用)为此我必须做的事情。请为此提供帮助
    • 好吧,你可能忘记了头文件。但是听起来您的问题是您不了解Objective-C,也许您应该花一些时间来更好地学习该语言?这个问题链接到许多好的网站:stackoverflow.com/questions/7571/…
    • 是的,我是 Objective c 的新手。但是我必须尽快开发这个应用程序,请帮助我,再次感谢您的帮助
    • 尝试在 .m 文件的开头添加#import "LaunchAtLoginController.h"。
    • 我在“LaunchAtLoginController.m”的开头添加了“LaunchAtLoginController.h”。但仍然遇到同样的错误和第二件事,我没有为此使用任何用户界面。
    猜你喜欢
    • 2019-12-14
    • 2020-04-07
    • 2011-07-30
    • 2021-05-30
    • 1970-01-01
    • 2021-05-16
    • 1970-01-01
    • 2017-03-20
    • 2020-09-05
    相关资源
    最近更新 更多