Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface MySingleton : NSObject {
- CTFontRef paintingFont;
- }
- @property (readonly) CTFontRef paintingFont;
- @end
- @implementation MySingleton
- + (MySingleton*)sharedInstance
- {
- static dispatch_once_t once;
- static MySingleton *sharedInstance;
- dispatch_once(&once, ^{
- sharedInstance = [[self alloc] init];
- //NB
- sharedInstance->paintingFont =
- CTFontCreateWithName(CFSTR("Helvetica"), 80.0, nil);
- });
- return sharedInstance;
- }
- @end
- sharedInstance->_paintingFont =
- CTFontCreateWithName(CFSTR("Helvetica"), 80.0, nil);
- @interface MySingleton ()
- @property (readwrite) CTFontRef paintingFont;
- @end
- @implementation MySingleton
- @synthesize paintingFont;
- ....
- @end
Add Comment
Please, Sign In to add comment