0

Im making a quiz based game in which has multiple view controllers that all share a "Skip Question" button. The user will have 3 skips and can purchase more at any time. I'm trying to create a class in which i can use a sharedInstance that i can use to add skips or use one, but what I don't under stand is how to retrieve the amount of skips they have on one of my view controllers. For example:

My Integer Class .h

int skips;

My Integer Class .m

skips = 3;

My ViewController.h

int vcSkips;

My ViewController.m

vcSkips = [MyIntegerclass skips];

Just an example. How can I do this?

  • possible duplicate of [Objective C Static Class Level variables](http://stackoverflow.com/questions/1063229/objective-c-static-class-level-variables) – Dirk Feb 12 '13 at 23:22

1 Answers1

0

You'll want to use a static variable:

http://www.learncpp.com/cpp-tutorial/811-static-member-variables/

Christian Stewart
  • 15,217
  • 20
  • 82
  • 139
  • Google "Objective C Static Variable" - possible duplicate http://stackoverflow.com/questions/1063229/objective-c-static-class-level-variables – Christian Stewart Feb 06 '13 at 02:15