In the book’s 444th page the code is crashing. I followed the code with break point and the variable backgroundMusic is always nil. Maybe this crash is happening after new update of Xcode. I tried to run the final template of the chapter 17 and it also crashing in the same line
Thanks for your comment but still not working. As I followed the code with debugging breakpoint the backgroundMusic variable is still nil. The code is not giving any error but there is no music playing either. Also shouldn’t we need to add backgroundMusic as child to scene but since it is nil this will give error of course. I hope ray and their team releases an update. Any help is appreciated.
actually We don’t need to add child or insert those two additional lines as I don’t have them in my code and it plays the background music perfect so maybe there is another issue at hand,if you like I will send you a complete copy of my game scene . swift file for you to compare with yours
DropCharge Background crash solution for xcode 7.3 is:
Firstly to add sounds file properly create a group named sounds and right click on it then click “Add files to” then select sound files .caf .wav etc. from resources. When directly dragging the resources to the environment it did not see the files as it shows the folder with not yellow but blue icon.
Secondly FOR CODİNG PART in the properties creat background music directly by typing
var backgroundMusic = SKAudioNode(fileNamed: “SpaceGame.caf”)
This temporarily gets me past the issue on page 444, but as you progress through it doesn’t fix the issue because you renamed the method so the other examples that send a file name parameter to that method needs to be addressed too.