Defining a property & synthesize for a variable in a singleton class allowed?,like below in interface,
@property(nonatomic,assign)NSInteger value;
and in implementation file,
@synthesize value;
or we just have to declare a variable like below,
@interface SingletonDataClass : NSObject
{
NSInteger value;
}
Anything that you can do with your regular classes you can do with singletons.
There is no language concept called "singleton", it is just a common usage pattern of regular Objective C classes. What makes a class a singleton is the way you ensure its instantiation happens only once, i.e. your own supporting code.