It seems we always use a sharedInstance
class variable to access the Singleton and perform methods on it. But why don't we just make all operations class methods and not have a variable to deal with at all? [SingletonClass uploadFile:(NSFile *)file]
instead of [[SingletonClass sharedInstance] uploadFile:(NSFile *)file]
(or the Swift equivalent).
What benefits do the variable bring? Or am I just overlooking some very integral concept in Singletons that not having a variable would prevent?
Furthermore, what stops this variable from being deallocated by memory? I know it's only created once, but why doesn't it ever get removed?