sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.34k stars 1.04k forks source link

Silencing Unknown class 'SPUStandardUpdaterController' warnings #2508

Closed massimobio closed 6 months ago

massimobio commented 6 months ago

My Mac app has two targets. One for the Mac App Store and one for direct distribution which uses the Sparkle library. I don't include Sparkle in the MAS target so I always see this warning in Xcode:

Screenshot 2024-02-18 at 11 33 39 PM

and this warning in the console when running the app:

Unknown class 'SPUStandardUpdaterController', using 'NSObject' instead. Encountered in Interface Builder file at path '.../MainMenu.nib'.
Could not connect action. Target class 'NSObject' does not respond to '-checkForUpdates:'.

I attempted to silence this warning by creating a placeholder class for the MAS target:

class SPUStandardUpdaterController: NSObject {
    @IBAction func check(forUpdates sender: Any) {}
}

but it didn't work.

Short of having separate MainMenu.xib files for each target (not great for maintainability), is there some other way to silence these warnings?