views:

24

answers:

0

Hi, I have a .h file called LayerManagement.h, it defines a Layer variable:

Layer *managelayer;

I have a Layer class called HelloLayer, it defines:

+(id) scene
{
    Scene *scene = [Scene node];

    HelloLayer *thislayer = [HelloLayer node];

    man = [[ManageMove alloc] init];    


   > man.managelayer = thislayer;// can i do that?      

    [scene addChild: thislayer];

    return scene;
}

And when i turn back to LayerManagement.m, i do something like this:

HelloLayer *helloLayer = [HelloLayer alloc];
helloLayer = self.managelayer;

I want to receive thislayer object from HelloLayer, but i get some problems. What mistakes do i have?

Btw, in java, i alway use this way to convert objects:

HelloLayer *helloLayer = (HelloLayer)self.managelayer;

Can i do this in Objective C? (i do not need alloc or init HelloLayer)