嗨,我已经创建了一个 Xcode 音板,但是当我在我的 iPhone 上运行它时,我得到了这个错误,不知道如何解决它,你能帮忙吗?
//
// 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]));
}
}
错误是
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
线程 1:信号 SIGABRT
谢谢
这是视图控制器.h
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
@interface ViewController : UIViewController
- (IBAction)yooo:(id)sender;
- (IBAction)boom:(id)sender;
@end
这是视图控制器.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
这是我的代码与那个线程 1 错误!