0

hi i have created a Xcode soundboard but when i run it on my iPhone i get this error and not to sure how to solve it can you help ?

//
//  main.m
//  sound
//
//  Created by Paul masters on 27/04/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

the error is

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

thread 1: signal SIGABRT

THANKS

this is the view controller.h

#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>

@interface ViewController : UIViewController
- (IBAction)yooo:(id)sender;

- (IBAction)boom:(id)sender;


@end

this is the view controller.m

- (IBAction)yooo:(id)sender {

    CFBundleRef mainbundle = CFBundleGetMainBundle();
    CFURLRef soundFileUrlRef;
    soundFileUrlRef = CFBundleCopyResourceURL(mainbundle, (CFStringRef) @"tb1", CFSTR ("wav"), NULL); 
    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileUrlRef, &soundID);
    AudioServicesPlaySystemSound(soundID);}

- (IBAction)boom:(id)sender {


    CFBundleRef mainbundle = CFBundleGetMainBundle();
    CFURLRef soundFileUrlRef;
    soundFileUrlRef = CFBundleCopyResourceURL(mainbundle, (CFStringRef) @"ta1", CFSTR ("wav"), NULL); 
    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileUrlRef, &soundID);
    AudioServicesPlaySystemSound(soundID);
}


@end

this is my code with that thread 1 error!! here is a image of my code that failed

enter image description here

Almo
  • 15,538
  • 13
  • 67
  • 95

2 Answers2

1

what you need to do is locate build phases and then click + and add audio.framework and then try to run and build and all should be good.

Development
  • 217
  • 1
  • 2
  • 5
0

You need to set an exception breakpoint. See "Run > Stop on Objective-C exception" in Xcode 4?. If you don't have an exception breakpoint and an exception occurs, all you will see is just a SIGABRT with no stack, so you can't find out, what really happened.

Community
  • 1
  • 1
kuba
  • 7,329
  • 1
  • 36
  • 41