I have a navigation-type app where you start with a root viewController, and other views get pushed
onto the stack.
Question is, if my app uses Game Center in more than one view, should I allocate my GameCenter manager
as a singleton, so I can access it from everywhere, or should I allocate a new instance per view?
The problem I have with using a singleton, is that my GameCenter manager requires that
I setup a delegate. But, only one view can be set as its delegate. So, if I were to use it with
multiple views, it would mean I would have to change the delegate everytime I change the view.
Is this safe to do? Does it follow any kind of design practice?
onto the stack.
Question is, if my app uses Game Center in more than one view, should I allocate my GameCenter manager
as a singleton, so I can access it from everywhere, or should I allocate a new instance per view?
The problem I have with using a singleton, is that my GameCenter manager requires that
I setup a delegate. But, only one view can be set as its delegate. So, if I were to use it with
multiple views, it would mean I would have to change the delegate everytime I change the view.
Is this safe to do? Does it follow any kind of design practice?
Last edited: