4

What attribute better appropriates to singleton's properties? As I know singleton never deallocated, but I still have to retain its' properties or assign it's more correctly?

Cœur
  • 32,421
  • 21
  • 173
  • 232
GeRyCh
  • 1,482
  • 3
  • 13
  • 21

1 Answers1

2

Your best bet is to retain and release all of your singleton's properties exactly the same way that you would for a non-singleton.

This will make things much easier to maintain, especially if one day you (or someone else) have to convert this singleton class into a non-singleton class.

e.James
  • 109,080
  • 38
  • 170
  • 208
  • 1
    Also, please be sure that a singleton is really the best solution to your problem. Singletons are really just global variables, and they offer a similar collection of benefits and drawbacks. http://stackoverflow.com/questions/474613/how-should-i-refactor-my-code-to-remove-unnecessary-singletons – e.James Sep 12 '11 at 14:37