How to create static class int using iphone SDK
// MyClass.m #import "MyClass.h" @implementation MyClass - (id) init { self = [super init]; if (self) { [MyClass setCount:[MyClass getCount]+1]; } return self; } static int count = 0; + (int) getCount { return count; } + (void) setCount:(int) c { count = c; } @end
Log in to answer.
leothenerd 12:41 pm on December 21, 2009