How to use GDC for create a singleton class

priore Apr 5th, 2013 468 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. + (id)sharedInstance
  2. {
  3.     static dispatch_once_t once;
  4.     static id instance;
  5.     dispatch_once(&once, ^{
  6.         instance =;
  7.     });
  8.     return instance;
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand