[SKNode node] returns a initlialized node. ( https://developer.apple.com/library/ios/documentation/SpriteKit/Reference/SKNode_Ref/Reference/Reference.html#//apple_ref/occ/clm/SKNode/node )
If i subclass SKNode:
@interface MyClass : SKNode
And then in my designated initializer inside MyClass i call the super designated initializer (a class method).
@implementation MyClass
{
MyScene _MyScene;
}
- (instancetype)initWithScene:(MyScene *)myScene
{
_MyScene = myScene;
if (self = [SKNode node]) { // HERE I GET ERROR
}
return self;
}
ERROR: Using the result of an assignment as a condition without parenthesis And if i change it to:
if ((self = [SKNode node]))
I get: incompatible pointer types assigning to (MyClass *) from (SKNode *) What is the way to call super designated initializer if its a class method? I also tried calling self = (MyClass *)[SKNode node] but i get an strange error.