代码是:
NSString *presetURLPath = [[NSBundle mainBundle] pathForResource:@"FluidR3_GM" ofType:@"SF2"];
NSLog(@"Path: %@",presetURLPath);
该.sf2
文件在我的项目中退出,但输出为: Path: null.
什么原因??谁能解释一下!!!
尝试这个
NSString *resources = [[NSBundle mainBundle] resourcePath];
NSURL *audioPath = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@",resources,@"FluidR3_GM.SF2"]];
你需要通过NSURL