Problem with accessing classes from another class.

Posted by srikanth rongali on Stack Overflow See other posts from Stack Overflow or by srikanth rongali
Published on 2010-05-15T10:08:40Z Indexed on 2010/05/15 10:14 UTC
Read the original article Hit count: 189

I have a classA, classB,classC. I have another class classABC; All are CCLayer inherited.
I need to call all the classA, classB, classC from classABC.

#import <Foundation/Foundation.h>
#import "cocos2d.h"

@interface classABC : CCLayer {
classA *aClass;
}

 @property(nonatomic, retain)classA *aClass;

@end

#import "classABC"
#import "classA.h"
#import "classB.h"
#import "classC.h"

@implementation classABC


-(id)init
{
    if( (self  = [super init]) )
    {

        ClassA *aClass = [[ClassA alloc]init];
        CCScene *aClassS = [CCScene node];
        CCLayer * aClassL = [aClass node];

        [aClassS addChild: aClassL];

        [[CCDirector sharedDirector] setAnimationInterval:60.0/60];
        [[CCDirector sharedDirector] replaceScene: aClass];
    }
    return self;
}

@end

But I am not getting the classA displayed. How should I do it ?

Thank You.

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about cocos2d-iphone