ios - Sending message to Singleton Object -
i have singleton class
perform web service operations. suppose have created method -(void)getprofileswithname:(nsstring *)profilename
profile information. using block
objects response web service operations
class. since web service operations
singleton many objects can send same [self getprofileswithname:@"john"]
messages @ time. in scenario first object makes web service request not receive data .
what proper way perform web service operations using singleton class
? can use nsoperationqueue
?
nsoperationqueue
1 possibility. queue.addoperationwithblock(_ block: () -> void)
method adds new block. think without queue. not set block instance variable, use directly in success method or block.
Comments
Post a Comment