Guest User

Untitled

a guest
Oct 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. @implementation myClass
  2.  
  3. static myClass *singleton = nil;
  4.  
  5. +(myClass *)singleton {
  6.  
  7. // call with [myClass singleton];
  8.  
  9. if(!singleton) {
  10. singleton = [[self alloc] init];
  11. }
  12. return singleton;
  13. }
  14.  
  15. @end
Add Comment
Please, Sign In to add comment