开发者

URLForResource:withExtension: method always returns nil

I am testing the MixerHost sample code. However the following code: NSURL *beatsLoop = [[NSBundle开发者_如何学C mainBundle] URLForResource: @"beatsMono" withExtension: @"caf"]; the beatsLoop is nil.

What's the reason for that? Should I first create the beatsMono.caf file and then put into some specific path?

Any comments and solutions will be highly appreciated.

Thanks, finspoo


Should I first create the beatsMono.caf file and then put into some specific path?

Yes. The file beatsMono.caf (case sensitive!) must exist in your application bundle for that method to succeed. This is done by adding the file to the target as a resource in XCode, you cannot do it at runtime.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜