Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Game with Sprite Kit Intro to Sprite Kit Project Setup

in Xcode 6 which have been recently released the .m view looks different, showing different names in methods

// Create and configure the scene. GameScene *scene = [GameScene unarchiveFromFile:@"GameScene"]; scene.scaleMode = SKSceneScaleModeAspectFill;

for example this part differs from what I saw in your video.

4 Answers

Hugo Nordell
Hugo Nordell
5,340 Points

Hi Dmitry,

The reason nothing is showing up for you is because you're probably initializing and setting up your scene using an .sks file. In this case, the 'GameScene.sks'. This is the default procedure in XCode 6.

You can double check this by going into your GameViewController.m file and in your viewDidLoad method, you set your game scene as such:

GameScene *scene = [GameScene unarchiveFromFile:@"GameScene"];

You need to change this into

GameScene *scene = [GameScene sceneWithSize:skView.bounds.size];

Assuming you haven't renamed the GameScene.m file into something else. Now you should get your green square.

Kind regards,

Yes, there is supposed to be an object on the screen (a green square), but it's not there, despite the fact that I copied all the code...

Fabio Floris
Fabio Floris
526 Points

So I can not help you ... tell me what you're doing right and what 's your ultimate goal and paste the code here ...

Fabio Floris
Fabio Floris
526 Points

I have always used the same method (as in the video tutorial) and it always worked perfectly ... even with Xcode ios 6 and 8 ... it's just a different way ... but it is the same

Thank you for your answer and I believe you, nevertheless I'm doing all the same as in the video and Xcode won't give me any mistakes when I press build, but it doesn't display me any result, just an empty screen in the simulator.

Fabio Floris
Fabio Floris
526 Points

but you are doing a query or save ?? You need to see that data?

Fabio Floris thank you for your help, Hugo Nordel has already given the answer for what I'm very thankful!