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 trialCesar Guerrero
11,190 PointsGetting a runtime error when adding the music to my game, "Thread 1: signal SIGABRT"
Here is my code for the titleScene.m file
#import "TitleScene.h"
#import "GamePlayScene.h"
@interface TitleScene ()
@property (nonatomic) SKAction *pressStart;
@end
@implementation TitleScene
-(id)initWithSize:(CGSize)size
{
if (self = [super initWithSize:size])
{
SKSpriteNode *background = [SKSpriteNode spriteNodeWithImageNamed:@"splash_1"];
background.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
[self addChild:background];
self.pressStart = [SKAction playSoundFileNamed:@"PressStart.caff" waitForCompletion:NO];
}
return self;
}
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
GamePlayScene *gamePlayScene = [GamePlayScene sceneWithSize:self.frame.size];
SKTransition *transition = [SKTransition fadeWithDuration:1.0];
[self.view presentScene:gamePlayScene transition:transition];
}
@end
```
3 Answers
Stone Preston
42,016 Pointsthat means an exception was thrown. in the console if you scroll down there will be more information that will tell you more about what is actually causing the error
Jeff Golden
8,460 PointsI ran into the same issue, in my case it was telling me that the audio file couldn't be found in the bundle. Turned out when I imported the files I failed to check the Add To Targets checkbox in the import dialog, that confirms the copy of the file into the project. Hope this helps someone.
Nicholas Zoellner
2,180 Pointsyeah i had that problem, not setting the target to the project when importing the files threw this error when looking it up.
Cesar Guerrero
11,190 PointsCesar Guerrero
11,190 PointsAnd just like that, it worked.. Sorry to bother. I actually have no idea what was going on or what that error even is.