我正在使用以下代码根据用户单击的按钮加载一些声音。文件路径被testString完美加载,但是当 NSLogging 时URLToBeReturned,它以(null). 我不知道为什么它没有转移过来。
NSString *testString = [NSString stringWithString:[[NSBundle mainBundle] pathForResource:noteName ofType:@"m4a"]];
NSURL *URLToBeReturned = [NSURL URLWithString:testString];
return URLToBeReturned;