Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @implementation myClass
- static myClass *singleton = nil;
- +(myClass *)singleton {
- // call with [myClass singleton];
- if(!singleton) {
- singleton = [[self alloc] init];
- }
- return singleton;
- }
- @end
Add Comment
Please, Sign In to add comment