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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -