摘要:
View Code @interface Singleton : NSObject {}+ (Singleton *) sharedInstance;- (void) operation;@endView Code #import "Singleton.h"@implementation Singletonstatic Singleton *sharedSingleton_ = nil;- (void) operation{ // do something NSLog(@"Singleton");}+ (Singleton *) sharedInstan 阅读全文
摘要:
View Code @interface BrandingFactory : NSObject {}+ (BrandingFactory *) factory;- (UIView *) brandedView;- (UIButton *) brandedMainButton;- (UIToolbar *) brandedToolbar;@endView Code #define USE_ACME@implementation BrandingFactory+ (BrandingFactory *) factory{#if defined (USE_ACME) return [[[Acme... 阅读全文