Some methods of my class need to know how many times the class has been loaded. Do I need a Singleton for this, or are there other ways to do this? Are there static variables that I can attach to the class and then just increment them every time a viewDidLoad?
When the application starts, that value is resetted (=0). I’m not such a big singleton-friend, since that’s such a big overhead of methods in objective-c 😉
If you are after how many times a view has been loaded (displayed) then keep reading 🙂
The load might happen just once (even if you navigate to and fro a form).
If you are after how many time a view appears just create a static field and increment its value in viewWillAppear.