CCActionManager* sharedManager = [CCActionManager sharedManager]; CCDirector* sharedDirector = [CCDirector sharedDirector]; CCSpriteFrameCache* sharedCache = [CCSpriteFrameCache sharedSpriteFrameCache]; CCTextureCache* sharedTexCache = [CCTextureCache sharedTextureCache]; CCTouchDispatcher* sharedDispatcher = [CCTouchDispatcher sharedDispatcher]; CDAudioManager* sharedManager = [CDAudioManager sharedManager]; SimpleAudioEngine* sharedEngine = [SimpleAudioEngine sharedEngine];
シングルトン実装例
static MyManager *sharedManager = nil; + (MyManager*) sharedManager { if (sharedManager == nil) { sharedManager = [[MyManager alloc] init]; } return sharedManager; }
0 件のコメント:
コメントを投稿