objective c - Cannot add CCNode to Scene -


I have introdiscine, and I want to add a node, but it does not seem to work. There are two different ways that I tried to do this, and both failed.

The first path, unsuccessful:

in heart 2.h

  #import & lt; Foundation / Foundation.h & gt; #import "cocos2d.h" @ Interface Heart 2: CCNode {} @end  

In 2 M

  #import "Hearts2.h" @implementation IntroLayer.m in Hearts2 @end  

  - ( Id) init {// Apple Supers Return value self Specified with self-recommendation • [Super Init]; If (! Self) return (zero); Heart 2 * heart; [Self added baby: heart z: 2]; // Full refund self; } I did not expect that to work (actually I was disappointed and tried to see it in another way, just to see that it would work). I tried to do the actual effort, and also failed:  

in heart 1.h

  #import & lt; Foundation / Foundation. H & gt; #import "cocos2d.h" @ Interface Heart 1: CCNode + (Heart 1 *) node; - (id) Init; - (zero) selfAnimate; Given in @end  

I

  #import "Hearts1.h" @ Implementation Heart 1 {} + (Heart 1 *) node {return [All Self] init]; } - (id) init {self = [super init]; If (! Self) return (zero); Self return; } - (zero) delok {} - (zero) perinter {[super on inner]; } - Exact {zero} will always call on the super final [Super ONIX]; } - IntroLayer.m  
  - (ID) init {// Apple Apparatus Returns} with selfless returns (void) self-animated {} @ and  

Price self estimate [super init]; If (! Self) return (zero); Heart 1 * heart; [Self added baby: heart z: 2]; // Full refund self; }

Please, if someone can help me understand this, then I will do anything Thanks everyone very much. I always get seagyart, so I do not know what's going wrong. I'm sure I'm just stupid and do not know how to code and miss something simple.

  heart 2 * heart;  

If you have named your class Hearts2 then use the exact name, including the uppercase.

Second, you have created a variable but it will not be zero. If you are not using ARC (which you should do), then it will make an unpublished object.

This will make an example of Hearts2 , local var heart and add it as a child:

 < Code> heart 2 * heart = [heart 2 node]; [Self added baby: heart z: 2];  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -