1

我正在尝试使用 Sparkle 框架对我的 mac 应用程序进行自动或静默更新,并在我的 info.plist 中将密钥 SUEnableAutomaticChecks 添加为 YES。我在 AppController 中编写代码,如下所示:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    //Sparkle auto update
    SUUpdater *sparkleUpdater = [SUUpdater sharedUpdater];
    [sparkleUpdater checkForUpdates:self];
    sparkleUpdater.delegate = [[NRMUpdateDelegate alloc] init];
    [sparkleUpdater setAutomaticallyChecksForUpdates:YES];
    [sparkleUpdater setAutomaticallyDownloadsUpdates:YES];
    [sparkleUpdater checkForUpdatesInBackground];
}

我仍然得到更新程序窗口来更新安装新版本。我想在后台做这一切。

谁能建议我如何做到这一点....

4

1 回答 1

-1

根据文档,

[sparkleUpdater checkForUpdates:self];

/*!
    Explicitly checks for updates and displays a progress dialog while doing so.

    This method is meant for a main menu item.
    Connect any menu item to this action in Interface Builder,
    and Sparkle will check for updates and report back its findings verbosely
    when it is invoked.
 */
于 2016-08-18T15:19:16.703 回答