Singleton class on main thread - iPhone
cocoa, iphone, objective-c, singleton
Solution
The methods are called on the thread you invoke them from.
`dispatch_once` just ensures that the block passed to it is only executed once in the lifetime of the application. I don't think it uses threads and if it does, that is an implementation detail you don't need to worry about.
Problem
My question maybe is silly but i cannot understand this. I create a singleton class using this code. ``` + (GameRequestHandler *) sharedInstance { static dispatch_once_t pred; static GameRequestHandler *shared = nil; dispatch_once(&pred, ^{ shared = [[GameRequestHandler alloc] init]; }); return shared; } ``` When i call methods from this singleton object, are they called on the main thread or in a background thread?