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 trialDmitry Volchenko
852 Pointsin 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
5,340 PointsHi 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,
Dmitry Volchenko
852 PointsYes, 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
526 PointsSo 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
526 PointsI 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
Dmitry Volchenko
852 PointsThank 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
526 Pointsbut you are doing a query or save ?? You need to see that data?
Dmitry Volchenko
852 PointsFabio Floris thank you for your help, Hugo Nordel has already given the answer for what I'm very thankful!