Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ xcode 6.1:无法播放链接到按钮的WAV_C++_Ios_Objective C_Iphone_Audio - Fatal编程技术网

C++ xcode 6.1:无法播放链接到按钮的WAV

C++ xcode 6.1:无法播放链接到按钮的WAV,c++,ios,objective-c,iphone,audio,C++,Ios,Objective C,Iphone,Audio,我正在尝试向我创建的按钮添加声音wav。我相信我已经完成了所有必要的代码,但是我无法播放声音。有什么帮助吗 我已尝试添加链接到按钮的wav文件。使用Audioserviceplay和create功能,但仍然没有声音! 你好,世界,我正在尝试添加一个声音wav到我创建的按钮。我相信我已经完成了所有必要的代码,但是我无法播放声音。有什么帮助吗 我已尝试添加链接到按钮的wav文件。使用Audioserviceplay和create功能,但仍然没有声音 // // ViewController.m /

我正在尝试向我创建的按钮添加声音wav。我相信我已经完成了所有必要的代码,但是我无法播放声音。有什么帮助吗

我已尝试添加链接到按钮的wav文件。使用Audioserviceplay和create功能,但仍然没有声音! 你好,世界,我正在尝试添加一个声音wav到我创建的按钮。我相信我已经完成了所有必要的代码,但是我无法播放声音。有什么帮助吗

我已尝试添加链接到按钮的wav文件。使用Audioserviceplay和create功能,但仍然没有声音

//
//  ViewController.m
//  Jets Soundboard
//
//  Created by Daniel Bernardin on 2015-02-09.
//  Copyright (c) 2015 Jets Sound. All rights reserved.
//

#import "ViewController.h"

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

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
   [  super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




- (IBAction)TrueNorth:(id)sender {
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef soundFileURLRef;
    soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"TrueNorth", CFSTR("wav"), NULL);
    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
    AudioServicesPlaySystemSound(soundID);



}
@end

我的包含在顶部,也在项目中。有很多关于模拟器相关bug的报告。您是在设备上还是在模拟器上测试这个问题?那么它仍然可能与XC6中的模拟器错误有关