title: iOS Spritekit Cannot Run SKAction on a Subclassed SKSpriteNode
body: <p>For my question I would like a more conceptual answer rather than a code one.</p>
  
  <p>I have a iOS application using Spritekit. I have a class that subclasses a SKSpriteNode, so that I can add additional properties to the node. I am able to successfully create the SKSpriteNode and display it on my SKSpriteNode background and remove it using an action. However, when I run any actions such as:</p>
  
  <pre><code>SKAction * moveAction = [SKAction moveTo:CGPointMake(100, 100)   duration: 1];
  </code></pre>
  
  <p>It does not perform the action for my subclass. However, if I apply this same action towards another SKSpriteNode than it performs the action. These are created on a timer that runs every 5 seconds.</p>
  
  <p>Some example code follows:</p>
  
  <p><strong>MyScene.m:</strong></p>
  
  <pre><code>-(void) timeTest {
       MySubclass * subclassTest = [[MySubclass alloc] initWithImage:@"myImage"];
       SKSpriteNode *test = [SKSpriteNode spriteNodeWithImageNamed:@"myImage"];
       subclassTest.position = CGPointMake(0, 0);
       test.position = CGPointMake(0, 100);
  
       [self.background addChild:subclassTest];
       [self.background addChild:test];
  
       SKAction * moveAction = [SKAction moveTo:CGPointMake(300, 300)   duration: 2];
  
       [subclassTest runAction: moveAction];
       [test runAction: moveAction];
   }
  </code></pre>
  
  <p><strong>MySubclass.h</strong></p>
  
  <pre><code>#import &lt;SpriteKit/SpriteKit.h&gt;
  
  @interface MySubclass : SKSpriteNode
  
  -(MySubclass *) initWithImage: (NSString *) image
  
  @end
  </code></pre>
  
  <p><strong>MySubclass.m</strong></p>
  
  <pre><code>@implementation MySubclass
  
  -(MySubclass *) initWithImage: (NSString *) image
  {
      self = [MySubclass spriteNodeWithImageNamed:image];
  
      self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.size];
      self.physicsBody.dynamic = NO; // Doesnt move with physics
      self.physicsBody.categoryBitMask = MySubclassCategory; 
      self.physicsBody.contactTestBitMask = otherCategory;
      self.physicsBody.collisionBitMask = 0;
  
      return self;
  }
  
  -(void) runAction:(SKAction *)action
  {
      [super runAction:action];
      NSLog(@"Running action!");
  }
  
  @end
  </code></pre>
  
  <p>Whenever the action is run, it does log the message "Running action!", so I know it is getting to that method, just not executing the actions for some reason?</p>
  
  <p>Please let me know if you need any more code or information!
  Thanks.</p>