subclass's sharedClient Method
In the superClass,i defined a method called "sharedClient"
+ (id)sharedClient
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[self alloc]init];
});
return instance;
}
at this method i want to dispatch the object once .then i defined two
subclasses of the superClassBclass A,and class B.
i hope that after i've called the method sharedClient of A, there's a
sharedClient of A, and I"ve called the sharedClient of B, there's an
object of B.but it seems that if A and B called the method both, there
always be one object of the previously called classB
No comments:
Post a Comment