if( (self=[super init] ))
{
//cocos2D는 Layer이나 Scene이나 Node를 상속 받아서 사용 합니다.
//View단에서 움직이는 부분이 없으므로
//ViewController를 동적 생성 해줍니다.
//ADBannerView도 역시 동적 생성 해줍니다.
UIViewController *controller = [[UIViewController alloc]init]; //동적 생성.
controller.view.frame = CGRectMake(0,0,480,320); //Hello World가로 방향
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier480x32];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;//ADBannerContentSizeIdentifier480*32;
[controller.view addSubview:adView]; //View 위에 배너를 add하시면 됩니다.
[[[CCDirector sharedDirector] openGLView] addSubview:controller.view];
// create and initialize a Label
CCLabel* label = [CCLabel labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
// ask director the the window size
CGSize size = [[CCDirector sharedDirector] winSize];
// position the label on the center of the screen
label.position = ccp( size.width /2 , size.height/2 );
// add the label as a child to this Layer
[self addChild: label];
}
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
//adView.delegate = self;
adView.frame = CGRectMake(0,430,320,50);
[self addSubview:adView];