1

ArcadeHighScoreLayer.m

を使用して UITableView を追加しようとしています

@implementation ArcadeHighScoreLayer
{
    UITableView *table;
    int count[N_OF_SECTION];
}
- (void) onEnterTransitionDidFinish
{
 [[[CCDirector sharedDirector] view] addSubview:table];
}

しかし、私は警告を受けています

 "CCDirector may not respond to view"

 and my code through an exception "[CCDirectorDisplayLink view]: unrecognized selector sent to instance 0x7c66c80
    2013-06-13 17:50:08.394 Games[6068:12203] *** Terminating app due to uncaught exception of class '_NSZombie_NSException'
    libc++abi.dylib: terminate called throwing an exception** " 

どうして ?!このエラーを解決するには?! ありがとう!

4

2 に答える 2

2

In Cocos2d 2.0 use

AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
[app.navController.view addSubview:table];

Cocos2d 1.0 then use

AppDelegate* app = (AppDelegate*)[UIApplication sharedApplication].delegate;
[app.viewController.view  addSubview:table];
于 2013-06-13T12:55:38.320 に答える