ios - No known class method for selector 'generatorWithWorld:' -
I am trying to create a platform game on exode and this is my first project and I have come to this error and It says, "There is no known class method generator for the selector Worldworld:" "And I'm getting the error" Visible @ Interferfer Selector for 'HSWorld Generator' declares 'populate' "
This code is MyScene.h:
// // Colin the Adventure of Sloth // // Copyright (c) 2014 Snrskorp All rights reserved. // ** # import & lt; SpriteKit / SpriteKit.h> #import "HSWorldGenerator.h" ** @Missen @ Interfaces: SKen @ and MySenseM.M:
// // MyScene.m / // The Adventure of Colin The Sloth // // Created on 24/07/2014 // Copyright (C) 2014 SunnersCorp All Rights Reserved by Harpreet Sannar. // #import "MyScene.h" #import "HSSloth.h" @ MySen () @ Property BOOL has been started; @ Property is playing on BOOL; @end @ Implementation MySensen {HSLoth * Dull; Escond * World; HSWorld Generator * Generator; } - (id) initWithSize: (CGSize) size {if (self = [super initWithSize: size]) {/ * your view setup here / / self.anchorPoint = CGPointMake (0.5, 0.5); Self.backgroundColor = [SKColor colorWithRed: 0.15 green: 0.15 blue: 0.3 alpha: 1.0]; World = [escond node]; [Self-composite: world]; Generator = [World Wide Worldwide: [HSWorld Generator]]; ** This is where I get the first error [Self addChild: Generator]; [Generator populate]; ** This is the second where I get the second error ** lethargy = [HSLLoth lethargy]; [To add the world: lethargy]; } Healthy return; } - (zero) start {self.isStarted = YES; [Lethargic start]; } - (void) Explicit {NSLog (@ "clear method"); } - (zero) game on {nslog (@ "playwasely called method"); } - (zero) simulitijijs {{self-center ornode: sloth]; } - (zero) CenterOrnode: (SKNOD *) node {CGPint Postian Incenten = [Self Convert Point: Node. Revision Node: NodePier] ;; World.position = CG Pointsmakes (world.position.x - Postian Insin. X, world.position.y); } - (zero) touches: (NSSET *) touches the event: (UEIVENT *) event {if (self!) [Auto start]; And if (self-pronounced), [self clear]; Other [sloth jump]; } - (zero) Update: (CFTimeInterval) currentTime {/ * is called before each frame * /} @end HSWorldGenerator.h:
< Code> // // // Copyright / Copyright © 2014 SunnersCorp All Rights Reserved. Created by Harpreet Sannar on 24/07/2014 Created on 24/07/2014. // # IMPORT & lt; Spritekit / Spritekit H & gt; @ Interface HSWorld Generator: SKNode + (ID) Generator Worldworld: (SKNode *) World; - (zero) populate; - Generate (zero); @end HSWorld Generator. M:
// // HSWireld Generator. M // The Adventure of Colin Sloth // Produced by Harpreet Sunner on 24/07/2014 // Copyright (C) 2014 SunnersCorp Copyright Safe. // # Imports "HSWorld Generator H" @ Interface HSWireld Generator () @ Property Doubleview GroundX; @property double current oblique x; @ Property SKNode * world; @ Expandence @ HSWorld Generator + (ID) Generator Worldworld: (SKN *) World {HSWorld Generator * Generator = [HSWorld Generator Node]; Generator. CurrentGreen X = 0; Generator. Current obsthal x = 400; Generator.wold = world; Return generator; } - (zero) for populate {{int i = 0; 1 <3; i ++) [auto generate]; } - Generate {Zero} {SKSpriteNode * ground = [SKSpriteNode spriteNodeWithColor: [UIColor greenColor] Size: CGSizeMake (self.scene.frame.size.width, 100)]; Ground.position = CGExMake (Self-Crurant GroundX, -Effice.SenieFrame.im.height / 2+ Ground.Frame.im.edight.height / 2); Ground.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize: ground.size]; Ground.physicsBody.dynamic = No; [Self. Word Bilton: Ground]; Self.currentGroundX + = ground.frame.size.width; SKSPrintNode * Handicap = [SKSCPRTNIDRNINRNIDVTVcllor: [UIcolor red color] Size: CGSJack (40, 70)]; Obstacle.position = CGPXMake (Self-Crurant Obstalax X, Ground .position + Ground.frame. Size.height / 2 + barrier.frame.height / 2); Handicap PhysicsBody = [SKFixixBody BodyWriting: Shape: Hurdle Obstacle.physicsBody.dynamic = NO; [Self. Add Word: Obstacle]; Self.currentObstacleX + = 250; } @ And Can someone tell me what went wrong and how can I fix it, I appreciate it.
Thank you!
In your MyScene.h file, where you go to #import HSWorldGenerator.h Check it out. The error is telling you that it is not known where the class method is from. It seems that you try to import the header in MyScene.h. You have an extra '**' that can comment on that line
Comments
Post a Comment